about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2014-07-08introducing let-syntaxJohn Clements-3/+30
The let-syntax expander is different in that it doesn't apply a mark to its token trees before expansion. This is used for macro_rules, and it's because macro_rules is essentially MTWT's let-syntax. You don't want to mark before expand sees let-syntax, because there's no "after" syntax to mark again. In some sense, the cleaner approach might be to introduce a new AST node that macro_rules expands into; this would make it clearer that the expansion of a macro is distinct from the addition of a new macro binding. This should work for now, though...
2014-07-08self arg macro test caseJohn Clements-0/+13
2014-07-08replace idents with namesJohn Clements-8/+15
2014-07-08get rid of keyword idents, replace with namesJohn Clements-8/+8
should prevent future bugs
2014-07-08preserve context in parsing of `self` varrefJohn Clements-9/+11
2014-07-08remove unused fn, make SELF_KEYWORD_NAME publicJohn Clements-5/+1
2014-07-08test harness cleanupJohn Clements-27/+20
2014-07-08change if/else to matchJohn Clements-179/+197
2014-07-08added test for method arg hygieneJohn Clements-0/+13
2014-07-08auto merge of #15493 : brson/rust/tostr, r=pcwaltonbors-1390/+1557
This updates https://github.com/rust-lang/rust/pull/15075. Rename `ToStr::to_str` to `ToString::to_string`. The naive renaming ends up with two `to_string` functions defined on strings in the prelude (the other defined via `collections::str::StrAllocating`). To remedy this I removed `StrAllocating::to_string`, making all conversions from `&str` to `String` go through `Show`. This has a measurable impact on the speed of this conversion, but the sense I get from others is that it's best to go ahead and unify `to_string` and address performance for all `to_string` conversions in `core::fmt`. `String::from_str(...)` still works as a manual fast-path. Note that the patch was done with a script, and ended up renaming a number of other `*_to_str` functions, particularly inside of rustc. All the ones I saw looked correct, and I didn't notice any additional API breakage. Closes #15046.
2014-07-08std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.Richo Healey-1390/+1557
[breaking-change]
2014-07-08auto merge of #15521 : nick29581/rust/type, r=pcwaltonbors-178/+215
closes #13367 [breaking-change] Use `Sized?` to indicate a dynamically sized type parameter or trait (used to be `type`). E.g., ``` trait Tr for Sized? {} fn foo<Sized? X: Share>(x: X) {} ```
2014-07-08auto merge of #15518 : alexcrichton/rust/fix-some-crate-names, r=sfacklerbors-5/+54
The output file was only being renamed based off #[crate_name], not #[crate_id] or --crate-name. Both of these behaviors have been restored now.
2014-07-08rustc: Fix naming output files with --crate-nameAlex Crichton-5/+54
The output file was only being renamed based off #[crate_name], not #[crate_id] or --crate-name. Both of these behaviors have been restored now.
2014-07-08Change DST syntax: type -> Sized?Nick Cameron-178/+215
closes #13367 [breaking-change] Use `Sized?` to indicate a dynamically sized type parameter or trait (used to be `type`). E.g., ``` trait Tr for Sized? {} fn foo<Sized? X: Share>(x: X) {} ```
2014-07-08auto merge of #15508 : jakub-/rust/struct-pattern-witness, r=alexcrichtonbors-8/+12
2014-07-08auto merge of #15443 : pcwalton/rust/module-and-type-with-same-name, r=nick29581bors-15/+45
This will break code that looks like: struct Foo { ... } mod Foo { ... } Change this code to: struct Foo { ... } impl Foo { ... } Or rename the module. Closes #15205. [breaking-change] r? @nick29581
2014-07-08auto merge of #15406 : luqmana/rust/nop, r=pcwaltonbors-77/+185
Extend the null ptr optimization to work with slices, closures, procs, & trait objects by using the internal pointers as the discriminant. This decreases the size of `Option<&[int]>` (and similar) by one word.
2014-07-07auto merge of #15394 : pcwalton/rust/new-index-traits, r=nick29581bors-167/+433
This will break code that used the old `Index` trait. Change this code to use the new `Index` traits. For reference, here are their signatures: pub trait Index<Index,Result> { fn index<'a>(&'a self, index: &Index) -> &'a Result; } pub trait IndexMut<Index,Result> { fn index_mut<'a>(&'a mut self, index: &Index) -> &'a mut Result; } Closes #6515. [breaking-change] r? @nick29581
2014-07-07librustc: Update debuginfo.Luqman Aden-1/+5
2014-07-07auto merge of #15440 : pcwalton/rust/struct-aliases, r=brsonbors-68/+173
Closes #4508. r? @nick29581
2014-07-07Improve non-exhaustive pattern witnesses for structs with multiple fieldsJakub Wieczorek-8/+12
2014-07-07librustc (RFC #34): Implement the new `Index` and `IndexMut` traits.Patrick Walton-167/+433
This will break code that used the old `Index` trait. Change this code to use the new `Index` traits. For reference, here are their signatures: pub trait Index<Index,Result> { fn index<'a>(&'a self, index: &Index) -> &'a Result; } pub trait IndexMut<Index,Result> { fn index_mut<'a>(&'a mut self, index: &Index) -> &'a mut Result; } Closes #6515. [breaking-change]
2014-07-07librustc: Disallow modules and types from having the same name.Patrick Walton-15/+45
This will break code that looks like: struct Foo { ... } mod Foo { ... } Change this code to: struct Foo { ... } impl Foo { ... } Or rename the module. Closes #15205. [breaking-change]
2014-07-07Strip empty strings from link argsSteven Fackler-1/+21
Closes #15487
2014-07-07auto merge of #15496 : ruud-v-a/rust/patch-1, r=huonwbors-3/+2
Also removes redundant newline in code block.
2014-07-07auto merge of #15489 : jakub-/rust/issue-15488, r=pcwaltonbors-26/+56
Fixes #15488.
2014-07-07manual: Fix typo.Ruud van Asseldonk-3/+2
Also removes redundant newline in code block.
2014-07-07auto merge of #15411 : mitchmindtree/rust/master, r=alexcrichtonbors-0/+85
I ran `make check` and everything went smoothly. I also tested `#[deriving(Decodable, Encodable)]` on a struct containing both Cell<T> and RefCell<T> and everything now seems to work fine.
2014-07-07Implemented Decodable/Encodable for Cell and RefCell. Fixes #15395mitchmindtree-0/+85
Updated PR with fixme and test Updated PR with fixme and test
2014-07-07auto merge of #15464 : dotdash/rust/bool_stores, r=pcwaltonbors-85/+126
LLVM doesn't handle i1 value in allocas/memory very well and skips a number of optimizations if it hits it. So we have to do the same thing that Clang does, using i1 for SSA values, but storing i8 in memory. Fixes #15203.
2014-07-07Properly bind nested pattern bindings when there's more than oneJakub Wieczorek-26/+56
Fixes #15488.
2014-07-06auto merge of #15486 : jakub-/rust/test-case-12187, r=alexcrichtonbors-0/+36
Closes #12187.
2014-07-06Store booleans as i8 in memory to improve optimizations by LLVMBjörn Steinbrink-65/+115
LLVM doesn't really like types with a bit-width that isn't a multiple of 8 and disable various optimizations if it encounters such types used with loads/stores. OTOH, booleans must be represented as i1 when used as SSA values. To get the best results, we must use i1 for SSA values, and i8 when storing the value to memory. By using range asserts on loads, LLVM can eliminate the required zero-extend and truncate operations. Fixes #15203
2014-07-06Remove remainders from when booleans were i8Björn Steinbrink-21/+12
2014-07-06Add a test case for #12187, which appears to have been fixedJakub Wieczorek-0/+36
Closes #12187.
2014-07-06auto merge of #15467 : brson/rust/guideversion, r=alexcrichtonbors-1/+0
2014-07-06auto merge of #15465 : SimonSapin/rust/patch-4, r=alexcrichtonbors-1/+1
`Vec::push_all` with a length 1 slice seems to have significant overhead compared to `Vec::push`. ``` test new_push_byte ... bench: 6985 ns/iter (+/- 487) = 17 MB/s test old_push_byte ... bench: 19335 ns/iter (+/- 1368) = 6 MB/s ``` ```rust extern crate test; use test::Bencher; static TEXT: &'static str = "\ Unicode est un standard informatique qui permet des échanges \ de textes dans différentes langues, à un niveau mondial."; #[bench] fn old_push_byte(bencher: &mut Bencher) { bencher.bytes = TEXT.len() as u64; bencher.iter(|| { let mut new = String::new(); for b in TEXT.bytes() { unsafe { new.as_mut_vec().push_all([b]) } } }) } #[bench] fn new_push_byte(bencher: &mut Bencher) { bencher.bytes = TEXT.len() as u64; bencher.iter(|| { let mut new = String::new(); for b in TEXT.bytes() { unsafe { new.as_mut_vec().push(b) } } }) } ```
2014-07-06auto merge of #15456 : aochagavia/rust/guide, r=alexcrichtonbors-2/+2
Fixes https://github.com/rust-lang/rust/issues/15452
2014-07-06auto merge of #15454 : jakub-/rust/15453, r=huonwbors-0/+8
I forget we now have byte string literals.
2014-07-06auto merge of #15472 : luqmana/rust/snaps, r=alexcrichtonbors-15/+8
2014-07-06Register snapshot.Luqman Aden-15/+8
2014-07-06auto merge of #15441 : P1start/rust/lifetime-suggest, r=pcwaltonbors-1/+1
Closes #15433.
2014-07-06auto merge of #15439 : dotdash/rust/remove_entry_bcx, r=pcwaltonbors-28/+11
We no longer need to refer to the entry block from arbitrary places, so we can drop it from FunctionContext.
2014-07-06auto merge of #15417 : pfalabella/rust/rational-signed, r=alexcrichtonbors-0/+44
2014-07-05doc: --version no longer displays the host tripleBrian Anderson-1/+0
2014-07-06Optimize String::push_byte()Simon Sapin-1/+1
``` test new_push_byte ... bench: 6985 ns/iter (+/- 487) = 17 MB/s test old_push_byte ... bench: 19335 ns/iter (+/- 1368) = 6 MB/s ``` ```rust extern crate test; use test::Bencher; static TEXT: &'static str = "\ Unicode est un standard informatique qui permet des échanges \ de textes dans différentes langues, à un niveau mondial."; #[bench] fn old_push_byte(bencher: &mut Bencher) { bencher.bytes = TEXT.len() as u64; bencher.iter(|| { let mut new = String::new(); for b in TEXT.bytes() { unsafe { new.as_mut_vec().push_all([b]) } } }) } #[bench] fn new_push_byte(bencher: &mut Bencher) { bencher.bytes = TEXT.len() as u64; bencher.iter(|| { let mut new = String::new(); for b in TEXT.bytes() { unsafe { new.as_mut_vec().push(b) } } }) } ```
2014-07-05auto merge of #15319 : alexcrichton/rust/no-crate-id, r=brsonbors-716/+997
This is an implementation of [RFC 35](https://github.com/rust-lang/rfcs/blob/master/active/0035-remove-crate-id.md). The summary for this PR is the same as that of the RFC, with one addendum: * Removes the `#[crate_id]` attribute and knowledge of versions from rustc. * Added a `#[crate_name]` attribute similar to the old `#[crate_id]` attribute * Output filenames no longer have versions or hashes * Symbols no longer have versions (they still have hashes) * A new flag, `--extern`, is used to override searching for external crates * A new flag, `-C metadata=foo`, used when hashing symbols * [added] An old flag, `--crate-name`, was re purposed to specify the crate name from the command line. I tried to maintain backwards compatibility wherever possible (with warnings being printed). If I missed anywhere, however, please let me know! [breaking-change] Closes #14468 Closes #14469 Closes #14470 Closes #14471
2014-07-05auto merge of #15225 : Ryman/rust/liburl_minor, r=alexcrichtonbors-693/+622
See commits for info, a number of these are 'breaking', although liburl is marked experimental so I'm not sure that matters so much. First two commits will be impacted if #15138 is adopted, but it's a simple rename.
2014-07-05rustc: Default #[crate_name] on input, not outputAlex Crichton-33/+29