bors
d6c8028ce0
Auto merge of #26065 - Marwes:master, r=alexcrichton
...
PR for #26052 with the new order as written below.
```
//Querying
fn len(&self) -> usize
fn is_empty(&self) -> bool
fn width(&self, is_cjk: bool) -> usize
fn is_char_boundary(&self, index: usize) -> bool
//Slicing and char retrieval
fn as_bytes(&self) -> &[u8]
fn as_ptr(&self) -> *const u8
unsafe fn slice_unchecked(&self, begin: usize, end: usize) -> &str
fn slice_chars(&self, begin: usize, end: usize) -> &str
fn char_range_at(&self, start: usize) -> CharRange
fn char_range_at_reverse(&self, start: usize) -> CharRange
fn char_at(&self, i: usize) -> char
fn char_at_reverse(&self, i: usize) -> char
fn slice_shift_char(&self) -> Option<(char, &str)>
//Iterators
fn chars(&self) -> Chars
fn char_indices(&self) -> CharIndices
fn bytes(&self) -> Bytes
fn split_whitespace(&self) -> SplitWhitespace
fn words(&self) -> Words
fn lines(&self) -> Lines
fn lines_any(&self) -> LinesAny
fn nfd_chars(&self) -> Decompositions
fn nfkd_chars(&self) -> Decompositions
fn nfc_chars(&self) -> Recompositions
fn nfkc_chars(&self) -> Recompositions
fn graphemes(&self, is_extended: bool) -> Graphemes
fn grapheme_indices(&self, is_extended: bool) -> GraphemeIndices
fn utf16_units(&self) -> Utf16Units
//Searching
fn contains<'a, P>(&'a self, pat: P) -> bool where P: Pattern<'a>
fn starts_with<'a, P>(&'a self, pat: P) -> bool where P: Pattern<'a>
fn ends_with<'a, P>(&'a self, pat: P) -> bool where P: Pattern<'a>, P::Searcher: ReverseSearcher<'a>
fn find<'a, P>(&'a self, pat: P) -> Option<usize> where P: Pattern<'a>
fn rfind<'a, P>(&'a self, pat: P) -> Option<usize> where P: Pattern<'a>, P::Searcher: ReverseSearcher<'a>
fn split<'a, P>(&'a self, pat: P) -> Split<'a, P> where P: Pattern<'a>
fn rsplit<'a, P>(&'a self, pat: P) -> RSplit<'a, P> where P: Pattern<'a>, P::Searcher: ReverseSearcher<'a>
fn split_terminator<'a, P>(&'a self, pat: P) -> SplitTerminator<'a, P> where P: Pattern<'a>
fn rsplit_terminator<'a, P>(&'a self, pat: P) -> RSplitTerminator<'a, P> where P: Pattern<'a>, P::Searcher: ReverseSearcher<'a>
fn splitn<'a, P>(&'a self, count: usize, pat: P) -> SplitN<'a, P> where P: Pattern<'a>
fn rsplitn<'a, P>(&'a self, count: usize, pat: P) -> RSplitN<'a, P> where P: Pattern<'a>, P::Searcher: ReverseSearcher<'a>
fn matches<'a, P>(&'a self, pat: P) -> Matches<'a, P> where P: Pattern<'a>
fn rmatches<'a, P>(&'a self, pat: P) -> RMatches<'a, P> where P: Pattern<'a>, P::Searcher: ReverseSearcher<'a>
fn match_indices<'a, P>(&'a self, pat: P) -> MatchIndices<'a, P> where P: Pattern<'a>
fn rmatch_indices<'a, P>(&'a self, pat: P) -> RMatchIndices<'a, P> where P: Pattern<'a>, P::Searcher: ReverseSearcher<'a>
fn subslice_offset(&self, inner: &str) -> usize
//Trim
fn trim(&self) -> &str
fn trim_left(&self) -> &str
fn trim_right(&self) -> &str
fn trim_matches<'a, P>(&'a self, pat: P) -> &'a str where P: Pattern<'a>, P::Searcher: DoubleEndedSearcher<'a>
fn trim_left_matches<'a, P>(&'a self, pat: P) -> &'a str where P: Pattern<'a>
fn trim_right_matches<'a, P>(&'a self, pat: P) -> &'a str where P: Pattern<'a>, P::Searcher: ReverseSearcher<'a>
//Conversion
fn parse<F>(&self) -> Result<F, F::Err> where F: FromStr
fn replace(&self, from: &str, to: &str) -> String
fn to_lowercase(&self) -> String
fn to_uppercase(&self) -> String
fn escape_default(&self) -> String
fn escape_unicode(&self) -> String
```
2015-06-09 00:00:35 +00:00
bors
521f82eb12
Auto merge of #26079 - eefriedman:emit-closure, r=nrc
...
This isn't a very clean fix, but I'm not sure what a better fix would look
like.
Fixes #24779 .
2015-06-08 22:26:16 +00:00
bors
02c33b690b
Auto merge of #26077 - SimonSapin:patch-6, r=alexcrichton
...
With the latter is provided by the `From` conversion trait, the former is now completely redundant. Their code is identical. Let’s deprecate now and plan to remove in the next cycle. (It’s `#[unstable]`.)
r? @alexcrichton
CC @nagisa
2015-06-08 20:52:33 +00:00
Markus Westerlind
e772818294
Reordered the methods on str to improve doc sorting
2015-06-08 22:18:13 +02:00
bors
dc72834e2b
Auto merge of #26060 - funkill:fix_rustbook, r=alexcrichton
...
Case:
Russian translate of trpl use this structure:
```bash
rust_book_ru $ tree
.
├── README.md
├── src
│ ├── academic-research.md
...
└── SUMMARY.md
```
Links in table of content generated relative to the root dir, for example if i'm on the page `http://kgv.github.io/rust_book_ru/src/academic-research.html ` link to README.html will be `http://kgv.github.io/rust_book_ru/src/README.html `, not `http://kgv.github.io/rust_book_ru/README.html `.
Now we use old version of rustbook.
Sorry for my english
2015-06-08 19:18:31 +00:00
bors
4e14ef0516
Auto merge of #26044 - nagisa:canonicalize-metadata-loader, r=alexcrichton
...
This might fail when --extern library is a symlink to an invalid location. Instead just pretend it
doesn’t exist at all.
Fixes #26006
2015-06-08 17:44:30 +00:00
Eli Friedman
2442f830cb
Translate "ignored" closure expressions.
...
This isn't a very clean fix, but I'm not sure what a better fix would look
like.
Fixes #24779 .
2015-06-08 10:29:34 -07:00
bors
4a397dd33d
Auto merge of #25989 - jooert:implement_rfc839, r=Gankro
...
I had to use `impl<'a, V: Copy> Extend<(usize, &'a V)> for VecMap<V>` instead of `impl<'a, V: Copy> Extend<(&'a usize, &'a V)> for VecMap<V>` as that's what is needed for doing
```rust
let mut a = VecMap::new();
let b = VecMap::new();
b.insert(1, "foo");
a.extend(&b)
```
I can squash the commits after review.
r? @Gankro
2015-06-08 16:09:56 +00:00
Simon Sapin
c160192f5f
Replace usage of String::from_str with String:from
2015-06-08 16:55:35 +02:00
bors
61c43b4733
Auto merge of #26091 - chellmuth:pub-struct-field-span, r=nrc
...
Issue: #26083
Re-submitting https://github.com/rust-lang/rust/pull/26084
r? @nrc
2015-06-08 14:35:27 +00:00
bors
115121de3d
Auto merge of #26088 - tamird:llvm35-fixes, r=alexcrichton
...
rebase of #25739 , closes #25739 . r? @alexcrichton
2015-06-08 11:55:04 +00:00
Johannes Oertel
b36ed7d2ed
Implement RFC 839
...
Closes #25976 .
2015-06-08 12:05:33 +02:00
bors
1ade076f62
Auto merge of #26029 - GuillaumeGomez:const_check, r=Manishearth
...
Part of #24407 .
2015-06-08 09:54:32 +00:00
Guillaume Gomez
ae550bd987
Add error explanation for E0014
2015-06-08 08:18:03 +02:00
bors
bea1c4a78e
Auto merge of #25823 - oli-obk:static_to_const_lint, r=alexcrichton
...
r? @eddyb
2015-06-08 04:54:59 +00:00
Chris Hellmuth
905727246a
Add license
2015-06-07 22:33:54 -06:00
bors
717e8831b6
Auto merge of #26018 - nrc:codegen, r=@nikomatsakis
...
Closes #19826
r? @nikomatsakis
There is still some work to do until parallel codegen is perfect - we don't pass make check due to missing the symbol for registering a macro. But we do bootstrap with codegen_units=4 and pass make check without codegen_units, so I think it should land.
For the curious, make rustc-stage2 -j8:
```
codegen_units=1:
real 9m18.074s
user 11m59.858s
sys 0m13.281s
codegen_units=4:
real 6m3.672s
user 13m5.474s
sys 0m12.146s
```
Which is a 33% speedup :-)
2015-06-08 03:22:02 +00:00
David Voit
e36e97ba51
rustc_trans: 'assume' intrinsic is only available on LLVM >= 3.6
...
Based on the patch from Luca Bruno.
Instead of creating an empty C function in the rt, this version creates an shim
noop function using llvm. This function is declared as internal, and the
unsupported assume intrinsic and the shim gets completly removed by the
optimizer.
2015-06-07 22:47:01 -04:00
Luca Bruno
ce32f6412e
rustc_trans: don't hardcode llvm version for conditional intrinsics
...
This commit introduce a third parameter for compatible_ifn!, as new
intrinsics are being added in recent LLVM releases and there is no
need to hardcode a specific case.
Signed-off-by: Luca Bruno <lucab@debian.org>
2015-06-07 22:47:00 -04:00
Tamir Duberstein
1be9e6f055
Remove useless const
2015-06-07 22:43:21 -04:00
bors
dcc59c09a9
Auto merge of #26087 - fitzgen:improve-suggestion-hueristics, r=Aatch
...
This makes the maximum edit distance of typo suggestions a function of the typo'd name's length. FWIW, clang uses this same hueristic, and I've found their suggestions to be better than rustc's. Without something like this, you end up with suggestions that aren't related at all when there are short variable names.
See also https://github.com/rust-lang/rust/issues/20028#issuecomment-109767159
2015-06-08 01:48:59 +00:00
Nick Fitzgerald
93d01eb443
Make the maximum edit distance of typo suggestions a function of the typo'd name's length.
2015-06-07 18:01:33 -07:00
Nick Cameron
8d9a58131d
error due to rebase
2015-06-08 12:18:42 +12:00
Nick Cameron
83c73e327a
review changes - only show closure ids in verbose mode
2015-06-08 11:41:48 +12:00
Nick Cameron
79b0c89d50
Don't visit items in removed branches
...
Note that they will be visited anyway by base::trans_item, this just duplicates the items.
2015-06-08 11:41:48 +12:00
Nick Cameron
e9db5fb202
Tidying up, fix some minor linkage bugs, use ty flags to avoid caching closure types.
2015-06-08 11:41:48 +12:00
Chris Hellmuth
2938d92a35
Add a regression test for public struct field spans
2015-06-07 17:29:09 -06:00
Chris Hellmuth
a72283832d
StructField span should include pub
2015-06-07 16:34:03 -06:00
bors
8f9f2fe97e
Auto merge of #25912 - tshepang:better-str-examples, r=bluss
2015-06-07 20:59:20 +00:00
Simon Sapin
2ff42435c2
Deprecate String::from_str in favor of String::from
...
With the latter is provided by the `From` conversion trait, the former is now completely redundant. Their code is identical.
2015-06-07 22:36:58 +02:00
bors
776f87ef9e
Auto merge of #26070 - brson:nightlyfix, r=alexcrichton
...
Broken on nightly linux distcheck.
2015-06-07 19:25:56 +00:00
Tshepang Lekhonkhobe
0335a94a68
doc: improve some of str examples
2015-06-07 20:58:47 +02:00
Brian Anderson
b26a48868c
test: Ignore gdb-pretty-struct-and-enums.rs
...
Broken on nightly linux distcheck.
2015-06-07 11:10:56 -07:00
Oliver 'ker' Schneider
ec078a033b
change some statics to constants
2015-06-07 19:50:13 +02:00
Simonas Kazlauskas
ab86face01
Don’t ICE if fs::canonicalise fails in meta-load
...
This might fail when --extern library is a symlink to an invalid location. Instead just pretend it
doesn’t exist at all.
2015-06-07 20:34:12 +03:00
bors
64d32b057e
Auto merge of #26066 - steveklabnik:docs_on_a_plane, r=alexcrichton
...
When things get stabilized, they don't always have their docs updated to remove the gate.
2015-06-07 17:04:40 +00:00
bors
ae74652b4a
Auto merge of #26057 - audebert:master, r=alexcrichton
...
The constraint referenced here is:
```rust
fn foo<T>(t: T) where T: Trait<AssociatedType=u32> { /* */ }
```
2015-06-07 00:07:07 +00:00
Steve Klabnik
a3b19c8858
Remove many unneeded feature annotations in the docs
...
When things get stabilized, they don't always have their docs updated to remove the gate.
2015-06-06 18:58:35 -04:00
bors
72b03e5337
Auto merge of #26047 - chuckSMASH:patch-1, r=alexcrichton
...
The sensible default used here for the version number in the
auto-generated Cargo.toml is 0.1.0, not 0.0.1 (at least as of cargo
0.2.0-nightly efb482d).
2015-06-06 21:33:43 +00:00
funkill
5f5a84a59c
fix path in toc links
2015-06-06 23:27:35 +03:00
bors
98f6e40b6e
Auto merge of #26050 - bluss:linked-list, r=Gankro
...
The recent bug that was found in LinkedList reminded me of some general cleanup
that's been waiting for some time.
- Use a loop from the front in Drop, it works just as well and without an unsafe block
- Change Rawlink methods to use `unsafe` in an idiomatic way. This does mean that
we need an unsafe block for each dereference of a raw link. Even then, the extent
of unsafe-critical code is even larger of course, since safety depends on the whole
data structure's integrity. This is a general problem we are aware of.
- Some cleanup just to try to decrease the amount of Rawlink handling.
2015-06-06 18:40:11 +00:00
Ulrik Sverdrup
32037a5696
linked_list: Add Rawlink::from
2015-06-06 20:05:39 +02:00
Ulrik Sverdrup
16cefab795
linked_list: Add method Node::set_next
2015-06-06 20:05:39 +02:00
Ulrik Sverdrup
201852e56a
linked_list: Cleanup code in split_off
2015-06-06 20:05:38 +02:00
Rémi Audebert
27dd0dda1b
Fix small typo in diagnostics.rs
2015-06-06 18:32:49 +02:00
bors
bfd072db45
Auto merge of #26038 - eddyb:dst-nested, r=luqmana
...
Allows `Rc<RefCell<Trait>>` and other containers. Fixes #25351 .
r? @nrc This is the discussed strategy, more or less.
2015-06-06 15:32:26 +00:00
bors
d6b82428b5
Auto merge of #26045 - sourcefrog:patch-1, r=alexcrichton
...
File handles are inherited from, not by, the parent process
2015-06-06 12:28:50 +00:00
Ulrik Sverdrup
289d5db409
linked_list: Use unsafe properly for Rawlink methods
2015-06-06 14:26:39 +02:00
Ulrik Sverdrup
a090e1f411
linked_list: Use a safe loop in Drop
2015-06-06 14:26:39 +02:00
bors
c21fd9a34f
Auto merge of #26041 - Nashenas88:sync-send-libcore-char, r=alexcrichton
...
This is a test for #22709 .
2015-06-06 06:32:05 +00:00