Commit Graph

43512 Commits

Author SHA1 Message Date
bors
8025bc964c Auto merge of #26153 - dotdash:issue26127, r=luqmana
Fixes #26127
2015-06-10 10:05:39 +00:00
Matthew Astley
1ece005838 trpl: why (assignment == empty tuple) #26120 2015-06-10 11:02:31 +01:00
Nick Hamann
aace3675b7 Revise E0133 description.
Tweaks some of the wording so it reads better.
2015-06-10 02:18:53 -05:00
Nick Hamann
c8b088eb38 Add explanation for E0116 and update the error message.
Also updates the reference on this point.
2015-06-10 02:18:14 -05:00
Ulrik Sverdrup
1112a05b8f collections: Remove redundant slicing for str
This is a remnant from a previous implementation of the str methods.
Using `self` is fine now.
2015-06-10 09:15:07 +02:00
Ulrik Sverdrup
d43bf53948 Add str::split_at
Implement RFC rust-lang/rfcs#1123

Add str method str::split_at(mid: usize) -> (&str, &str).
2015-06-10 09:15:07 +02:00
bors
6c5834d81b Auto merge of #26137 - steveklabnik:gh25623, r=alexcrichton
Fixes #25623

I am bad with BNF, so I may have messed this up, but that's what review is for!
2015-06-10 06:59:31 +00:00
bors
e954031ea2 Auto merge of #26130 - steveklabnik:gh25986, r=alexcrichton
This can be confusing when whitespace is the separator

Fixes #25986
2015-06-10 05:28:03 +00:00
bors
172cd83490 Auto merge of #26058 - Kimundi:issue15609, r=nikomatsakis
Closes #15609
2015-06-10 03:15:16 +00:00
Johann Tuffe
cb31373dc2 early return if 1 element
No need to dedup if there is only 1 element in the vec, can early return
2015-06-10 10:51:48 +08:00
bors
5ea3ed0fd0 Auto merge of #26055 - arielb1:smart-fold, r=nikomatsakis
Before:
581.72user 4.75system 7:42.74elapsed 126%CPU (0avgtext+0avgdata 1176224maxresident)k
llvm took 359.183

After:
550.63user 5.09system 7:20.28elapsed 126%CPU (0avgtext+0avgdata 1165516maxresident)k
llvm took 354.801
2015-06-10 01:44:59 +00:00
Alex Crichton
56a5ff284a std: Tweak process raising/lowering implementations
* Slate these features to be stable in 1.2 instead of 1.1 (not being backported)
* Have the `FromRawFd` implementations follow the contract of the `FromRawFd`
  trait by taking ownership of the primitive specified.
* Refactor the implementations slightly to remove the `unreachable!` blocks as
  well as separating the stdio representation of `std::process` from
  `std::sys::process`.
2015-06-09 17:48:10 -07:00
Alex Crichton
ec68c4a835 std: Stabilize a number of new fs features
This commit stabilizes the following APIs, slating them all to be cherry-picked
into the 1.1 release.

* fs::FileType (and transitively the derived trait implementations)
* fs::Metadata::file_type
* fs::FileType::is_dir
* fs::FileType::is_file
* fs::FileType::is_symlink
* fs::DirEntry::metadata
* fs::DirEntry::file_type
* fs::DirEntry::file_name
* fs::set_permissions
* fs::symlink_metadata
* os::raw::{self, *}
* os::{android, bitrig, linux, ...}::raw::{self, *}
* os::{android, bitrig, linux, ...}::fs::MetadataExt
* os::{android, bitrig, linux, ...}::fs::MetadataExt::as_raw_stat
* os::unix::fs::PermissionsExt
* os::unix::fs::PermissionsExt::mode
* os::unix::fs::PermissionsExt::set_mode
* os::unix::fs::PermissionsExt::from_mode
* os::unix::fs::OpenOptionsExt
* os::unix::fs::OpenOptionsExt::mode
* os::unix::fs::DirEntryExt
* os::unix::fs::DirEntryExt::ino
* os::windows::fs::MetadataExt
* os::windows::fs::MetadataExt::file_attributes
* os::windows::fs::MetadataExt::creation_time
* os::windows::fs::MetadataExt::last_access_time
* os::windows::fs::MetadataExt::last_write_time
* os::windows::fs::MetadataExt::file_size

The `os::unix::fs::Metadata` structure was also removed entirely, moving all of
its associated methods into the `os::unix::fs::MetadataExt` trait instead. The
methods are all marked as `#[stable]` still.

As some minor cleanup, some deprecated and unstable fs apis were also removed:

* File::path
* Metadata::accessed
* Metadata::modified

Features that were explicitly left unstable include:

* fs::WalkDir - the semantics of this were not considered in the recent fs
  expansion RFC.
* fs::DirBuilder - it's still not 100% clear if the naming is right here and if
  the set of functionality exposed is appropriate.
* fs::canonicalize - the implementation on Windows here is specifically in
  question as it always returns a verbatim path. Additionally the Unix
  implementation is susceptible to buffer overflows on long paths unfortunately.
* fs::PathExt - as this is just a convenience trait, it is not stabilized at
  this time.
* fs::set_file_times - this funciton is still waiting on a time abstraction.
2015-06-09 17:44:13 -07:00
marcell
e87c62fb12 Modify String::push to reallocate more conservatively in case of the character's UTF-8 representation is bigger than 1 byte 2015-06-10 02:04:37 +02:00
Alex Crichton
9d6ffbdaa8 Revert "Added AsRef implementations for Arc and Rc"
This reverts commit 7f3ae0aa26.
2015-06-09 16:47:45 -07:00
Eduard Burtescu
76eaed44d9 syntax: move ast_map to librustc. 2015-06-10 02:40:45 +03:00
bors
2228ce10c6 Auto merge of #25836 - steveklabnik:gh25305, r=alexcrichton
Fixes #25794
2015-06-09 23:11:25 +00:00
Björn Steinbrink
96bc00f30e Use the correct type of undef value for ignored return values in trans_named_tuple_constructor
Fixes #26127
2015-06-10 00:07:47 +02:00
marcell
c5d0e2a073 Add missing #[inline] to methods related to char. 2015-06-09 23:58:00 +02:00
bors
ac67354392 Auto merge of #26150 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #26111, #26125, #26129, #26131, #26132, #26133, #26134, #26136, #26140, #26144
- Failed merges:
2015-06-09 21:36:03 +00:00
Steve Klabnik
6b6b380fd1 Rollup merge of #26144 - steveklabnik:static_doc_fix, r=alexcrichton
Fixes #25851

I am 99% sure this is true for all `static`s and not just `static mut`, yes?
2015-06-09 17:24:45 -04:00
Steve Klabnik
9bcae312a3 Rollup merge of #26140 - steveklabnik:gh25803, r=alexcrichton
As this example got changed, we stopped showing how to return self as
the first example, so this text is outdated.

Fixes #25803
2015-06-09 17:24:45 -04:00
Steve Klabnik
b38e9a73d4 Rollup merge of #26136 - steveklabnik:gh25597, r=alexcrichton
Fixes #25597
2015-06-09 17:24:44 -04:00
Steve Klabnik
d16906283a Rollup merge of #26134 - steveklabnik:gh25586, r=alexcrichton
After talking with @graydon on #rust-internals, this is hopefully clarifying.

Fixes #25586

@mkpankov, what do you think?
2015-06-09 17:24:44 -04:00
Steve Klabnik
496fe4d51a Rollup merge of #26133 - steveklabnik:gh25573, r=alexcrichton
This obscures more than it helps.

Fixes #25573
2015-06-09 17:24:44 -04:00
Steve Klabnik
8a55e5399f Rollup merge of #26132 - astraw:fix-demangle-comment, r=alexcrichton
Hi, I think the second example fails rule 3 described immediately above. This PR fixes that.
2015-06-09 17:24:44 -04:00
Steve Klabnik
91a9f82596 Rollup merge of #26131 - astraw:fix-trait-comment, r=alexcrichton
Hi, I think the comments are wrong in the example and this PR offers my suggested fix.
2015-06-09 17:24:43 -04:00
Steve Klabnik
67bb4e9356 Rollup merge of #26129 - steveklabnik:gh26012, r=brson
Fixes #26012
2015-06-09 17:24:43 -04:00
Steve Klabnik
c7de6aa342 Rollup merge of #26125 - nsimplex:master, r=steveklabnik
The text claimed 'any borrow must last for a _smaller_ scope than the
owner', however the accurate way of describing the comparison is
inclusive (i.e., 'less than or equal to' vs. 'less than').
2015-06-09 17:24:43 -04:00
Steve Klabnik
32c6deec07 Rollup merge of #26111 - tshepang:consistency, r=brson 2015-06-09 17:24:42 -04:00
Steve Klabnik
2c75256c15 Exise 'unsafe pointer' in favor of 'raw pointer'
Using two terms for one thing is confusing, these are called 'raw pointers' today.
2015-06-09 16:49:24 -04:00
Steve Klabnik
34e5c24c5d make note of slicing syntax in TRPL: strings
Fixes #25853
2015-06-09 16:37:47 -04:00
Steve Klabnik
9db9449836 Make note about static and dtors
Fixes #25851
2015-06-09 16:30:39 -04:00
Steve Klabnik
a3cd5eb1bd Exise 'owned pointer' from the codebase
Still some references left to this old term, I've updated them to say boxes.

Related to #25851
2015-06-09 16:26:21 -04:00
Steve Klabnik
b242a86864 Mention that enum constructors are functions
Fixes #25850
2015-06-09 16:12:45 -04:00
bors
f06e026578 Auto merge of #26039 - SimonSapin:case-mapping, r=alexcrichton
* Add “complex” mappings to `char::to_lowercase` and `char::to_uppercase`, making them yield sometimes more than on `char`: #25800. `str::to_lowercase` and `str::to_uppercase` are affected as well.
* Add `char::to_titlecase`, since it’s the same algorithm (just different data). However this does **not** add `str::to_titlecase`, as that would require UAX#29 Unicode Text Segmentation which we decided not to include in of `std`: https://github.com/rust-lang/rfcs/pull/1054 I made `char::to_titlecase` immediately `#[stable]`, since it’s so similar to `char::to_uppercase` that’s already stable. Let me know if it should be `#[unstable]` for a while.
* Add a special case for upper-case Sigma in word-final position in `str::to_lowercase`: #26035. This is the only language-independent conditional mapping currently in `SpecialCasing.txt`.
* Stabilize `str::to_lowercase` and `str::to_uppercase`. The `&self -> String` on `str` signature seems straightforward enough, and the only relevant issue I’ve found is #24536 about naming. But `char` already has stable methods with the same name, and deprecating them for a rename doesn’t seem worth it.

r? @alexcrichton
2015-06-09 20:00:32 +00:00
Steve Klabnik
a95b48c2dd Fix some copyediting in TRPL: method-syntax
As this example got changed, we stopped showing how to return self as
the first example, so this text is outdated.

Fixes #25803
2015-06-09 15:49:57 -04:00
Steve Klabnik
6c452bebc5 Remove numbers all together from not_found.html 2015-06-09 15:47:48 -04:00
Steve Klabnik
a0b08f387b Explain interaction with if and | in patterns
Fixes #26012
2015-06-09 15:40:09 -04:00
Steve Klabnik
6bddfc9650 Fix up macro grammar
Fixes #25623
2015-06-09 15:26:51 -04:00
Steve Klabnik
e12c420522 Expand a bit on clone() in Dining Philosophers
Fixes #25597
2015-06-09 15:24:44 -04:00
Steve Klabnik
a9899a7353 Clarify confusing sentence in TRPL: FFI
After talking with @graydon on #rust-internals, this is hopefully clarifying.

Fixes #25586
2015-06-09 15:17:30 -04:00
Steve Klabnik
f62ad7d7df remove stuff about #define
This obscures more than it helps.

Fixes #25573
2015-06-09 14:59:25 -04:00
Andrew Straw
1fff553fe7 fix comments in example about types 2015-06-09 20:49:52 +02:00
Andrew Straw
24c596c650 fix example in comments about demangling 2015-06-09 20:47:51 +02:00
Steve Klabnik
96c7a6b8fe Document str::split behavior with contiguous separators
This can be confusing when whitespace is the separator

Fixes #25986
2015-06-09 14:42:55 -04:00
bors
8a3f5af8c9 Auto merge of #25995 - alexcrichton:msvc-md, r=brson
On MSVC there are two ways that the CRT can be linked, either statically or
dynamically. Each object file produced by the compiler is compiled against
msvcrt (a dll) or libcmt (a static library). When the linker is dealing with
more than one object file, it requires that all object files link to the same
CRT, or else the linker will spit out some errors.

For now, compile code with `-MD` as it seems to appear more often in C libraries
so we'll stick with the same trend.
2015-06-09 18:26:26 +00:00
simplex
0a70c94d68 Semantic accuracy in borrow scope rules.
The text claimed 'any borrow must last for a _smaller_ scope than the
owner', however the accurate way of describing the comparison is
inclusive (i.e., 'less than or equal to' vs. 'less than').
2015-06-09 13:08:16 -03:00
Ulrik Sverdrup
4fdb4cfa89 Implement Borrow<T> and BorrowMut<T> for Box<T: ?Sized> 2015-06-09 16:15:38 +02:00
Marvin Löbel
d6b7ca041a Made ref pattern bindings correctly pick Deref or DerefMut
Added LvaluePreference::from_mutbl

Closes #15609
2015-06-09 16:02:00 +02:00