- 22 7月, 2014 1 次提交
-
-
由 Alex Crichton 提交于
Closes #15828
-
- 21 7月, 2014 1 次提交
-
-
由 bors 提交于
Makes working with syntax deriving a bit more pleasuring. For instance, once can use local (non-static) strings anywhere inside `TraitDef` now.
-
- 20 7月, 2014 16 次提交
-
-
由 bors 提交于
Fix small typo in guide.
-
由 bors 提交于
Summary: * alloc::rc module stable * Rc type stable * Functions relating to weak references experimental * core::cmp module stable * PartialEq/Eq/PartialOrd/Ord unstable because trait reform will make them change again * Equiv experimental because there may be better sol'ns * lexical_ordering deprecated because it can be done trivially with the Ord trait * min/max stable * std::task module stable * TaskBuilder::stdout/stderr experimental because we aren't certain we want to configure the environment this way * try_future experimental because Future is experimental * try unstable because the error type might change * deschedule/failing unstable The major thing I did differently than previously-discussed is that I made `try` experimental: there's been discussion that the error type `Box<Any + Send>` is not sufficient. Per https://github.com/rust-lang/meeting-minutes/blob/master/Meeting-API-review-2014-07-16.md.
-
由 Steve Klabnik 提交于
-
由 bors 提交于
Fix for #15780.
-
由 bors 提交于
`call_visit_glue` is only ever called from trans_intrinsic, and the block won't be unreachable there. Also, the comment doesn't make sense anymore. When the code was introduced in 38fee952 the function was also responsible for the cleanup glue, which is no longer the case. While we're at it, also fixed the debug message to output the right function name.
-
由 bors 提交于
Simplify example in 5.2 to remove hidden `#[deriving(Show)]`. Traits haven't been introduced yet and now it's easier to just type in the code and expect it to work. Add in some examples for constructing the enum types. Explicitly expose `#![feature(struct_variant)]` in the code to make it more transparent, this bit me when I worked through the tutorial. Add references in chapter 8 to later chapters describing `Rc`, `Gc` and `Send`. This is a simple fix for #15293. Simplify vector indexing example in chapter 13 and removed hidden, unnecessary, code. Gave an example usage of the derived `Rand` trait in chapter 17. Removed references to removed 'extra' crate.
-
由 bors 提交于
-
由 Alex Crichton 提交于
-
由 bors 提交于
This implements RFC 39. Omitted lifetimes in return values will now be inferred to more useful defaults, and an error is reported if a lifetime in a return type is omitted and one of the two lifetime elision rules does not specify what it should be. This primarily breaks two uncommon code patterns. The first is this: unsafe fn get_foo_out_of_thin_air() -> &Foo { ... } This should be changed to: unsafe fn get_foo_out_of_thin_air() -> &'static Foo { ... } The second pattern that needs to be changed is this: enum MaybeBorrowed<'a> { Borrowed(&'a str), Owned(String), } fn foo() -> MaybeBorrowed { Owned(format!("hello world")) } Change code like this to: enum MaybeBorrowed<'a> { Borrowed(&'a str), Owned(String), } fn foo() -> MaybeBorrowed<'static> { Owned(format!("hello world")) } Closes #15552. [breaking-change] r? @nick29581
-
由 bors 提交于
This branch of try_send() just forgot to wake up any receiver waiting for data. Closes #15761
-
由 bors 提交于
This is now linked to in the guide, so I want to make sure it's good. This adds a bit more explanation, and brings usage in line with current good style.
-
由 bors 提交于
This is accomplished by rewriting static expressions into equivalent patterns. This way, patterns referencing static variables can both participate in exhaustiveness analysis as well as be compiled down into the appropriate branch of the decision trees that match expressions are codegened to. Fixes #6533. Fixes #13626. Fixes #13731. Fixes #14576. Fixes #15393.
-
由 Dzmitry Malyshau 提交于
-
由 Patrick Walton 提交于
This implements RFC 39. Omitted lifetimes in return values will now be inferred to more useful defaults, and an error is reported if a lifetime in a return type is omitted and one of the two lifetime elision rules does not specify what it should be. This primarily breaks two uncommon code patterns. The first is this: unsafe fn get_foo_out_of_thin_air() -> &Foo { ... } This should be changed to: unsafe fn get_foo_out_of_thin_air() -> &'static Foo { ... } The second pattern that needs to be changed is this: enum MaybeBorrowed<'a> { Borrowed(&'a str), Owned(String), } fn foo() -> MaybeBorrowed { Owned(format!("hello world")) } Change code like this to: enum MaybeBorrowed<'a> { Borrowed(&'a str), Owned(String), } fn foo() -> MaybeBorrowed<'static> { Owned(format!("hello world")) } Closes #15552. [breaking-change]
-
由 bors 提交于
Three small changes: 1. Re-organize headers in the Strings guide so they show up correctly. 2. build the strings guide with the other docs 3. include the strings guide in the list of guides
-
由 bors 提交于
Example how to use the set with a custom type. Fill in examples for the missing methods. Also group implemented traits below `HashSet` method impl.
-
- 19 7月, 2014 22 次提交
-
-
由 bors 提交于
Reimplement the string slice's `Iterator<char>` by wrapping the already efficient slice iterator. The iterator uses our guarantee that the string contains valid UTF-8, but its only unsafe code is transmuting the decoded `u32` into `char`. Benchmarks suggest that the runtime of `Chars` benchmarks are reduced by up to 30%, runtime of `Chars` reversed reduced by up to 60%. ``` BEFORE test str::bench::char_indicesator ... bench: 124 ns/iter (+/- 1) test str::bench::char_indicesator_rev ... bench: 188 ns/iter (+/- 9) test str::bench::char_iterator ... bench: 122 ns/iter (+/- 2) test str::bench::char_iterator_ascii ... bench: 302 ns/iter (+/- 41) test str::bench::char_iterator_for ... bench: 123 ns/iter (+/- 4) test str::bench::char_iterator_rev ... bench: 189 ns/iter (+/- 14) test str::bench::char_iterator_rev_for ... bench: 177 ns/iter (+/- 4) AFTER test str::bench::char_indicesator ... bench: 85 ns/iter (+/- 3) test str::bench::char_indicesator_rev ... bench: 82 ns/iter (+/- 2) test str::bench::char_iterator ... bench: 100 ns/iter (+/- 3) test str::bench::char_iterator_ascii ... bench: 317 ns/iter (+/- 3) test str::bench::char_iterator_for ... bench: 86 ns/iter (+/- 2) test str::bench::char_iterator_rev ... bench: 80 ns/iter (+/- 6) test str::bench::char_iterator_rev_for ... bench: 68 ns/iter (+/- 0) ``` Note: Branch name is no longer indicative of the implementation.
-
由 root 提交于
Only one uint is needed to keep track of the offset from the original full string.
-
由 bors 提交于
Fixes #15400.
-
由 bors 提交于
-
由 bors 提交于
Someone rightfully complained in IRC that DList was lacking examples. Here are some.
-
-
由 bors 提交于
The first is to require that `#[crate_name]` and `--crate-name` always match (if both are specified). The second is to fix parallel compilation in cargo by mixing in `-C extra-filename` into the temporary outputs of the compiler.
-
由 Brian Anderson 提交于
Most stable. deschedule/failing experimental because of concerns about naming and desirability. Adds task::name() to replace deprecated task::with_name().
-
由 Brian Anderson 提交于
Weak pointers experimental. Most everything else stable.
-
由 Brian Anderson 提交于
All stable.
-
由 Steve Klabnik 提交于
This is now linked to in the guide, so I want to make sure it's good. This adds a bit more explanation, and brings usage in line with current good style.
-
由 Alex Crichton 提交于
When invoking the compiler in parallel, the intermediate output of the object files and bytecode can stomp over one another if two crates with the same name are being compiled. The output file is already being disambiguated with `-C extra-filename`, so this commit alters the naming of the temporary files to also mix in the extra filename to ensure that file names don't clash.
-
由 Jakub Wieczorek 提交于
This is accomplished by rewriting static expressions into equivalent patterns. This way, patterns referencing static variables can both participate in exhaustiveness analysis as well as be compiled down into the appropriate branch of the decision trees that match expressions are codegened to. Fixes #6533. Fixes #13626. Fixes #13731. Fixes #14576. Fixes #15393.
-
由 Brian Anderson 提交于
Mark Eq, PartialEq, Ord, PartialOrd as unstable: they will change slightly after trait reform. Equiv as experimental: better solutions are desired. min/max stable.
-
由 root 提交于
Thanks to comments from @alexcrichton, write the next/next_back function bodies without nested functions in a more top-to-bottom flow style. Also improve comment style and motivate the unsafe blocks with comments.
-
由 root 提交于
Thanks to comments from @huonw, clarify decoding details and use statics for important constants for UTF-8 decoding. Convert some magic numbers scattered in the same file to use the statics too.
-
由 bors 提交于
Matches the official sample output (N=200) again. cc #15408
-
由 Björn Steinbrink 提交于
call_visit_glue() is only ever called with None as its last argument, so we can remove it as well.
-
由 Luqman Aden 提交于
-
由 Luqman Aden 提交于
-
由 Luqman Aden 提交于
-
由 Luqman Aden 提交于
-