]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoAuto merge of #26190 - Veedrac:no-iter, r=alexcrichton
bors [Thu, 11 Jun 2015 18:10:08 +0000 (18:10 +0000)]
Auto merge of #26190 - Veedrac:no-iter, r=alexcrichton

Pull request for #26188.

9 years agoAuto merge of #26212 - Manishearth:rollup, r=Manishearth
bors [Thu, 11 Jun 2015 16:33:53 +0000 (16:33 +0000)]
Auto merge of #26212 - Manishearth:rollup, r=Manishearth

- Successful merges: #26181, #26184, #26189, #26191, #26195, #26202
- Failed merges:

9 years agoAuto merge of #26197 - dhuseby:fixing_morestack_breakage, r=brson
bors [Thu, 11 Jun 2015 14:57:13 +0000 (14:57 +0000)]
Auto merge of #26197 - dhuseby:fixing_morestack_breakage, r=brson

Revision 021e483 broke the BSD builds.  This fixes it for Bitrig and probably the others.

9 years agoAuto merge of #26184 - aepsil0n:error-desc-funcargs, r=alexcrichton
bors [Thu, 11 Jun 2015 13:17:19 +0000 (13:17 +0000)]
Auto merge of #26184 - aepsil0n:error-desc-funcargs, r=alexcrichton

These errors all relate to type checking, specifically the number of function arguments, and occur in librustc_typeck::check::check_argument_types.

Resolves part of #24407.

9 years agoConver reborrows to .iter() calls where appropriate
Joshua Landau [Thu, 11 Jun 2015 12:56:07 +0000 (13:56 +0100)]
Conver reborrows to .iter() calls where appropriate

9 years agoAuto merge of #26177 - jooert:fix26169, r=alexcrichton
bors [Thu, 11 Jun 2015 11:41:24 +0000 (11:41 +0000)]
Auto merge of #26177 - jooert:fix26169, r=alexcrichton

Closes #26169.

r? @steveklabnik

9 years agoAuto merge of #26172 - nham:add_E0116, r=alexcrichton
bors [Thu, 11 Jun 2015 10:06:38 +0000 (10:06 +0000)]
Auto merge of #26172 - nham:add_E0116, r=alexcrichton

Also improves the wording of the E0133 description.

cc #24407

9 years agoAuto merge of #26159 - alexcrichton:tweak-process-lowering-raising, r=brson
bors [Thu, 11 Jun 2015 08:22:39 +0000 (08:22 +0000)]
Auto merge of #26159 - alexcrichton:tweak-process-lowering-raising, r=brson

* 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`.

cc #25494

9 years agoRollup merge of #26202 - nham:revise_E0072, r=alexcrichton
Manish Goregaokar [Thu, 11 Jun 2015 07:20:54 +0000 (12:50 +0530)]
Rollup merge of #26202 - nham:revise_E0072, r=alexcrichton

Converts the size calculation in the explanation from a fenced code block to an indented one. I think it looks better when not rendered, and is the same rendered.

9 years agoRollup merge of #26195 - tshepang:patch-1, r=alexcrichton
Manish Goregaokar [Thu, 11 Jun 2015 07:20:53 +0000 (12:50 +0530)]
Rollup merge of #26195 - tshepang:patch-1, r=alexcrichton

9 years agoRollup merge of #26191 - jimblandy:master, r=steveklabnik
Manish Goregaokar [Thu, 11 Jun 2015 07:20:53 +0000 (12:50 +0530)]
Rollup merge of #26191 - jimblandy:master, r=steveklabnik

In the discussion of returning closures, it seems like the example code got simplified, but only the later copies got fixed. The final working code has `factory` returning `|x| x + num`, but the earlier code has `|x| vec.push(x)`.

The first form seemed to have more distracting characteristics, and the code wasn't right anyway, so I changed them to all use the second form, and updated the error messages.

r? @steveklabnik

9 years agoRollup merge of #26189 - bluss:iter-once-clone, r=Gankro
Manish Goregaokar [Thu, 11 Jun 2015 07:20:53 +0000 (12:50 +0530)]
Rollup merge of #26189 - bluss:iter-once-clone, r=Gankro

core: impl Clone for option::IntoIter and iter::Once

9 years agoRollup merge of #26184 - aepsil0n:error-desc-funcargs, r=alexcrichton
Manish Goregaokar [Thu, 11 Jun 2015 07:20:53 +0000 (12:50 +0530)]
Rollup merge of #26184 - aepsil0n:error-desc-funcargs, r=alexcrichton

These errors all relate to type checking, specifically the number of function arguments, and occur in librustc_typeck::check::check_argument_types.

Resolves part of #24407.

9 years agoRollup merge of #26181 - Stebalien:fix-26178, r=steveklabnik
Manish Goregaokar [Thu, 11 Jun 2015 07:20:52 +0000 (12:50 +0530)]
Rollup merge of #26181 - Stebalien:fix-26178, r=steveklabnik

The list of in-production users is probably incomplete. It's based on a [post](https://www.reddit.com/r/rust/comments/2x567m/who_is_using_rust_or_what_projects_that_are/cox7eby) by /u/mozilla_kmc

closes #26178

9 years agoAuto merge of #26155 - dhuseby:fixing_bitrig_net_tests, r=alexcrichton
bors [Thu, 11 Jun 2015 06:46:25 +0000 (06:46 +0000)]
Auto merge of #26155 - dhuseby:fixing_bitrig_net_tests, r=alexcrichton

… congruent due to rounding errors

@semarie this affected both openbsd and bitrig.  it seems the correct solution is to switch to fixed point arithmetic in the timeout code, the same as freebsd.

9 years agoAuto merge of #26154 - pmarcelll:master, r=Gankro
bors [Thu, 11 Jun 2015 05:05:20 +0000 (05:05 +0000)]
Auto merge of #26154 - pmarcelll:master, r=Gankro

Various methods in both libcore/char.rs and librustc_unicode/char.rs were previously marked with #[inline], now every method is marked in char's impl blocks.
Partially fixes #26124.
EDIT: I'm not familiar with pull reqests (yet), apparently Github added my second commit to thit PR...
Fixes #26124

9 years agoAuto merge of #26122 - bluss:borrow-box, r=alexcrichton
bors [Thu, 11 Jun 2015 03:25:45 +0000 (03:25 +0000)]
Auto merge of #26122 - bluss:borrow-box, r=alexcrichton

Implement Borrow<T> and BorrowMut<T> for Box<T: ?Sized>

9 years agoRevise the E0072 explanation.
Nick Hamann [Thu, 11 Jun 2015 02:36:32 +0000 (21:36 -0500)]
Revise the E0072 explanation.

9 years agoAuto merge of #25839 - bluss:str-split-at-impl, r=alexcrichton
bors [Thu, 11 Jun 2015 00:22:27 +0000 (00:22 +0000)]
Auto merge of #25839 - bluss:str-split-at-impl, r=alexcrichton

Implement RFC rust-lang/rfcs#1123

Add str method str::split_at(mid: usize) -> (&str, &str).

Also a minor cleanup in the collections::str module. Remove redundant slicing of self.

9 years agoAuto merge of #25777 - shepmaster:cstring-return-to-c, r=alexcrichton
bors [Wed, 10 Jun 2015 22:37:38 +0000 (22:37 +0000)]
Auto merge of #25777 - shepmaster:cstring-return-to-c, r=alexcrichton

As far as I was able to determine, it's currently *impossible* to allocate a C NUL-terminated string in Rust and then return it to C (transferring ownership), without leaking memory. There is support for passing the string to C (borrowing).

To complicate matters, it's not possible for the C code to just call `free` on the allocated string, due to the different allocators in use.

`CString` has no way to recreate itself from a pointer. This commit adds one. This is complicated a bit because Rust `Vec`s want the pointer, size, and capacity.

To deal with that, another method to shrink and "leak" the `CString` to a `char *` is also provided.

We can then use `strlen` to determine the length of the string, which must match the capacity.

**TODO**

- [x] Improve documentation
- [x] Add stability markers
- [x] Convert to `Box<[u8]>`

### Example code

With this example code:

```rust
#![feature(libc)]
#![feature(cstr_to_str)]
#![feature(c_str_memory)]

extern crate libc;

use std::ffi::{CStr,CString};

#[no_mangle]
pub extern fn reverse(s: *const libc::c_char) -> *const libc::c_char {
    let s = unsafe { CStr::from_ptr(s) };
    let s2 = s.to_str().unwrap();
    let s3: String = s2.chars().rev().collect();
    let s4 = CString::new(s3).unwrap();
    s4.into_ptr()
}

#[no_mangle]
pub extern fn cleanup(s: *const libc::c_char) {
    unsafe { CString::from_ptr(s) };
}
```

Compiled using `rustc --crate-type dylib str.rs`, I was able to link against it from C (`gcc -L. -l str str.c -o str`):

```c
#include <stdio.h>

extern char *reverse(char *);
extern void cleanup(char *);

int main() {
  char *s = reverse("Hello, world!");
  printf("%s\n", s);
  cleanup(s);
}
```

As well as dynamically link via Ruby:

```ruby
require 'fiddle'
require 'fiddle/import'

module LibSum
  extend Fiddle::Importer

  dlload './libstr.dylib'
  extern 'char* reverse(char *)'
  extern 'void cleanup(char *)'
end

s = LibSum.reverse("hello, world!")
puts s
LibSum.cleanup(s)
```

9 years agodoc: typo fix
Tshepang Lekhonkhobe [Wed, 10 Jun 2015 22:19:45 +0000 (00:19 +0200)]
doc: typo fix

9 years agoAuto merge of #24689 - SimonSapin:formatter-write-char, r=alexcrichton
bors [Wed, 10 Jun 2015 21:02:08 +0000 (21:02 +0000)]
Auto merge of #24689 - SimonSapin:formatter-write-char, r=alexcrichton

This is the logical next step after #24661, but I’m less sure about this one.

r? @alexcrichton

9 years agoFix examples for returning closures.
Jim Blandy [Wed, 10 Jun 2015 20:17:49 +0000 (13:17 -0700)]
Fix examples for returning closures.

9 years agoRemoved many pointless calls to *iter() and iter_mut()
Joshua Landau [Wed, 10 Jun 2015 16:22:20 +0000 (17:22 +0100)]
Removed many pointless calls to *iter() and iter_mut()

9 years agoHave std::fmt::Formatter implement std::fmt::Write.
Simon Sapin [Wed, 10 Jun 2015 19:41:34 +0000 (21:41 +0200)]
Have std::fmt::Formatter implement std::fmt::Write.

9 years agocore: impl Clone for option::IntoIter and iter::Once
Ulrik Sverdrup [Wed, 10 Jun 2015 18:57:39 +0000 (20:57 +0200)]
core: impl Clone for option::IntoIter and iter::Once

9 years agoAuto merge of #26182 - Manishearth:rollup, r=Manishearth
bors [Wed, 10 Jun 2015 18:41:42 +0000 (18:41 +0000)]
Auto merge of #26182 - Manishearth:rollup, r=Manishearth

- Successful merges: #26142, #26143, #26145, #26146, #26164, #26174
- Failed merges:

9 years agoAdd a write_char method to std::fmt::Formatter.
Simon Sapin [Wed, 22 Apr 2015 12:18:02 +0000 (14:18 +0200)]
Add a write_char method to std::fmt::Formatter.

This is the logical next step after #24661, but I’m less sure about this one.

9 years agoAdd error explanation for E0057, E0059–E0061
Eduard Bopp [Wed, 10 Jun 2015 18:16:37 +0000 (20:16 +0200)]
Add error explanation for E0057, E0059–E0061

These errors all relate to type checking, specifically the number of function
arguments, and occur in librustc_typeck::check::check_argument_types.

9 years agofixes __morestack symbol problem on BSDs
Dave Huseby [Wed, 10 Jun 2015 17:20:57 +0000 (10:20 -0700)]
fixes __morestack symbol problem on BSDs

9 years agodisabling socking timing tests because openbsd/bitrig get/set are not congruent due...
Dave Huseby [Tue, 9 Jun 2015 16:36:17 +0000 (09:36 -0700)]
disabling socking timing tests because openbsd/bitrig get/set are not congruent due to rounding errors

9 years agoRollup merge of #26174 - mcast:trpl-assignment-empty-tuple, r=steveklabnik
Manish Goregaokar [Wed, 10 Jun 2015 16:37:10 +0000 (22:07 +0530)]
Rollup merge of #26174 - mcast:trpl-assignment-empty-tuple, r=steveklabnik

Doc patch for #26120.  Extra words here, because "value" is repeated.

I haven't read about whether/how it should go to stable (sorry), but I think it would help newcomers.

Thanks,

9 years agoRollup merge of #26164 - tafia:early-dedup, r=Gankro
Manish Goregaokar [Wed, 10 Jun 2015 16:37:10 +0000 (22:07 +0530)]
Rollup merge of #26164 - tafia:early-dedup, r=Gankro

No need to dedup if there is only 1 element in the vec, can early return

9 years agoRollup merge of #26146 - steveklabnik:remove_unsafe_pointer, r=Gankro
Manish Goregaokar [Wed, 10 Jun 2015 16:37:10 +0000 (22:07 +0530)]
Rollup merge of #26146 - steveklabnik:remove_unsafe_pointer, r=Gankro

Using two terms for one thing is confusing, these are called 'raw pointers' today.

9 years agoRollup merge of #26145 - steveklabnik:gh25853, r=brson
Manish Goregaokar [Wed, 10 Jun 2015 16:37:10 +0000 (22:07 +0530)]
Rollup merge of #26145 - steveklabnik:gh25853, r=brson

Fixes #25853

9 years agoRollup merge of #26143 - steveklabnik:gh25851, r=alexcrichton
Manish Goregaokar [Wed, 10 Jun 2015 16:37:09 +0000 (22:07 +0530)]
Rollup merge of #26143 - steveklabnik:gh25851, r=alexcrichton

Still some references left to this old term, I've updated them to say boxes.

Related to #25851

9 years agoRollup merge of #26142 - steveklabnik:gh25850, r=Gankro
Manish Goregaokar [Wed, 10 Jun 2015 16:37:09 +0000 (22:07 +0530)]
Rollup merge of #26142 - steveklabnik:gh25850, r=Gankro

Fixes #25850

9 years agoRust is now post-1.0
Steven Allen [Wed, 10 Jun 2015 15:47:44 +0000 (11:47 -0400)]
Rust is now post-1.0

closes #26178

9 years agoImprove examples for atomic types.
Johannes Oertel [Wed, 10 Jun 2015 14:53:09 +0000 (16:53 +0200)]
Improve examples for atomic types.

Swap arguments of `assert_eq!` calls, insert additional assertions
here and there.
Closes #26169.

9 years agomend bad Markdown
Matthew Astley [Wed, 10 Jun 2015 15:15:24 +0000 (16:15 +0100)]
mend bad Markdown

9 years agoAuto merge of #26141 - eddyb:ast_map, r=nikomatsakis
bors [Wed, 10 Jun 2015 11:38:04 +0000 (11:38 +0000)]
Auto merge of #26141 - eddyb:ast_map, r=nikomatsakis

Gets libsyntax one step closer to running on stable (see #24518).
Closes #24757, erickt's previous attempt at this.

9 years agoAuto merge of #26153 - dotdash:issue26127, r=luqmana
bors [Wed, 10 Jun 2015 10:05:39 +0000 (10:05 +0000)]
Auto merge of #26153 - dotdash:issue26127, r=luqmana

Fixes #26127

9 years agotrpl: why (assignment == empty tuple) #26120
Matthew Astley [Wed, 10 Jun 2015 09:59:36 +0000 (10:59 +0100)]
trpl: why (assignment == empty tuple) #26120

9 years agoRevise E0133 description.
Nick Hamann [Wed, 10 Jun 2015 05:37:36 +0000 (00:37 -0500)]
Revise E0133 description.

Tweaks some of the wording so it reads better.

9 years agoAdd explanation for E0116 and update the error message.
Nick Hamann [Tue, 9 Jun 2015 08:05:24 +0000 (03:05 -0500)]
Add explanation for E0116 and update the error message.

Also updates the reference on this point.

9 years agocollections: Remove redundant slicing for str
Ulrik Sverdrup [Wed, 27 May 2015 20:57:10 +0000 (22:57 +0200)]
collections: Remove redundant slicing for str

This is a remnant from a previous implementation of the str methods.
Using `self` is fine now.

9 years agoAdd str::split_at
Ulrik Sverdrup [Tue, 9 Jun 2015 09:23:22 +0000 (11:23 +0200)]
Add str::split_at

Implement RFC rust-lang/rfcs#1123

Add str method str::split_at(mid: usize) -> (&str, &str).

9 years agoAuto merge of #26137 - steveklabnik:gh25623, r=alexcrichton
bors [Wed, 10 Jun 2015 06:59:31 +0000 (06:59 +0000)]
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!

9 years agoAuto merge of #26130 - steveklabnik:gh25986, r=alexcrichton
bors [Wed, 10 Jun 2015 05:28:03 +0000 (05:28 +0000)]
Auto merge of #26130 - steveklabnik:gh25986, r=alexcrichton

This can be confusing when whitespace is the separator

Fixes #25986

9 years agoAuto merge of #26058 - Kimundi:issue15609, r=nikomatsakis
bors [Wed, 10 Jun 2015 03:15:16 +0000 (03:15 +0000)]
Auto merge of #26058 - Kimundi:issue15609, r=nikomatsakis

Closes #15609

9 years agoearly return if 1 element
Johann Tuffe [Wed, 10 Jun 2015 02:51:48 +0000 (10:51 +0800)]
early return if 1 element

No need to dedup if there is only 1 element in the vec, can early return

9 years agoAuto merge of #26055 - arielb1:smart-fold, r=nikomatsakis
bors [Wed, 10 Jun 2015 01:44:59 +0000 (01:44 +0000)]
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

9 years agostd: Tweak process raising/lowering implementations
Alex Crichton [Tue, 9 Jun 2015 23:41:14 +0000 (16:41 -0700)]
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`.

9 years agoModify String::push to reallocate more conservatively in case of the character's...
marcell [Wed, 10 Jun 2015 00:03:56 +0000 (02:03 +0200)]
Modify String::push to reallocate more conservatively in case of the character's UTF-8 representation is bigger than 1 byte

9 years agosyntax: move ast_map to librustc.
Eduard Burtescu [Tue, 9 Jun 2015 23:40:45 +0000 (02:40 +0300)]
syntax: move ast_map to librustc.

9 years agoAuto merge of #25836 - steveklabnik:gh25305, r=alexcrichton
bors [Tue, 9 Jun 2015 23:11:25 +0000 (23:11 +0000)]
Auto merge of #25836 - steveklabnik:gh25305, r=alexcrichton

Fixes #25794

9 years agoUse the correct type of undef value for ignored return values in trans_named_tuple_co...
Björn Steinbrink [Tue, 9 Jun 2015 22:07:47 +0000 (00:07 +0200)]
Use the correct type of undef value for ignored return values in trans_named_tuple_constructor

Fixes #26127

9 years agoAdd missing #[inline] to methods related to char.
marcell [Tue, 9 Jun 2015 21:58:00 +0000 (23:58 +0200)]
Add missing #[inline] to methods related to char.

9 years agoAuto merge of #26150 - steveklabnik:rollup, r=steveklabnik
bors [Tue, 9 Jun 2015 21:36:03 +0000 (21:36 +0000)]
Auto merge of #26150 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #26111, #26125, #26129, #26131, #26132, #26133, #26134, #26136, #26140, #26144
- Failed merges:

9 years agoRollup merge of #26144 - steveklabnik:static_doc_fix, r=alexcrichton
Steve Klabnik [Tue, 9 Jun 2015 21:24:45 +0000 (17:24 -0400)]
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?

9 years agoRollup merge of #26140 - steveklabnik:gh25803, r=alexcrichton
Steve Klabnik [Tue, 9 Jun 2015 21:24:45 +0000 (17:24 -0400)]
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

9 years agoRollup merge of #26136 - steveklabnik:gh25597, r=alexcrichton
Steve Klabnik [Tue, 9 Jun 2015 21:24:44 +0000 (17:24 -0400)]
Rollup merge of #26136 - steveklabnik:gh25597, r=alexcrichton

Fixes #25597

9 years agoRollup merge of #26134 - steveklabnik:gh25586, r=alexcrichton
Steve Klabnik [Tue, 9 Jun 2015 21:24:44 +0000 (17:24 -0400)]
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?

9 years agoRollup merge of #26133 - steveklabnik:gh25573, r=alexcrichton
Steve Klabnik [Tue, 9 Jun 2015 21:24:44 +0000 (17:24 -0400)]
Rollup merge of #26133 - steveklabnik:gh25573, r=alexcrichton

This obscures more than it helps.

Fixes #25573

9 years agoRollup merge of #26132 - astraw:fix-demangle-comment, r=alexcrichton
Steve Klabnik [Tue, 9 Jun 2015 21:24:44 +0000 (17:24 -0400)]
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.

9 years agoRollup merge of #26131 - astraw:fix-trait-comment, r=alexcrichton
Steve Klabnik [Tue, 9 Jun 2015 21:24:43 +0000 (17:24 -0400)]
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.

9 years agoRollup merge of #26129 - steveklabnik:gh26012, r=brson
Steve Klabnik [Tue, 9 Jun 2015 21:24:43 +0000 (17:24 -0400)]
Rollup merge of #26129 - steveklabnik:gh26012, r=brson

Fixes #26012

9 years agoRollup merge of #26125 - nsimplex:master, r=steveklabnik
Steve Klabnik [Tue, 9 Jun 2015 21:24:43 +0000 (17:24 -0400)]
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').

9 years agoRollup merge of #26111 - tshepang:consistency, r=brson
Steve Klabnik [Tue, 9 Jun 2015 21:24:42 +0000 (17:24 -0400)]
Rollup merge of #26111 - tshepang:consistency, r=brson

9 years agoExise 'unsafe pointer' in favor of 'raw pointer'
Steve Klabnik [Tue, 9 Jun 2015 20:49:24 +0000 (16:49 -0400)]
Exise 'unsafe pointer' in favor of 'raw pointer'

Using two terms for one thing is confusing, these are called 'raw pointers' today.

9 years agomake note of slicing syntax in TRPL: strings
Steve Klabnik [Tue, 9 Jun 2015 20:37:47 +0000 (16:37 -0400)]
make note of slicing syntax in TRPL: strings

Fixes #25853

9 years agoMake note about static and dtors
Steve Klabnik [Tue, 9 Jun 2015 20:30:39 +0000 (16:30 -0400)]
Make note about static and dtors

Fixes #25851

9 years agoExise 'owned pointer' from the codebase
Steve Klabnik [Tue, 9 Jun 2015 20:26:21 +0000 (16:26 -0400)]
Exise 'owned pointer' from the codebase

Still some references left to this old term, I've updated them to say boxes.

Related to #25851

9 years agoMention that enum constructors are functions
Steve Klabnik [Tue, 9 Jun 2015 20:12:43 +0000 (16:12 -0400)]
Mention that enum constructors are functions

Fixes #25850

9 years agoAuto merge of #26039 - SimonSapin:case-mapping, r=alexcrichton
bors [Tue, 9 Jun 2015 20:00:32 +0000 (20:00 +0000)]
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

9 years agoFix some copyediting in TRPL: method-syntax
Steve Klabnik [Tue, 9 Jun 2015 19:49:54 +0000 (15:49 -0400)]
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

9 years agoRemove numbers all together from not_found.html
Steve Klabnik [Tue, 9 Jun 2015 19:47:48 +0000 (15:47 -0400)]
Remove numbers all together from not_found.html

9 years agoExplain interaction with if and | in patterns
Steve Klabnik [Tue, 9 Jun 2015 18:32:10 +0000 (14:32 -0400)]
Explain interaction with if and | in patterns

Fixes #26012

9 years agoFix up macro grammar
Steve Klabnik [Tue, 9 Jun 2015 19:26:51 +0000 (15:26 -0400)]
Fix up macro grammar

Fixes #25623

9 years agoExpand a bit on clone() in Dining Philosophers
Steve Klabnik [Tue, 9 Jun 2015 19:24:44 +0000 (15:24 -0400)]
Expand a bit on clone() in Dining Philosophers

Fixes #25597

9 years agoClarify confusing sentence in TRPL: FFI
Steve Klabnik [Tue, 9 Jun 2015 19:17:25 +0000 (15:17 -0400)]
Clarify confusing sentence in TRPL: FFI

After talking with @graydon on #rust-internals, this is hopefully clarifying.

Fixes #25586

9 years agoremove stuff about #define
Steve Klabnik [Tue, 9 Jun 2015 18:59:25 +0000 (14:59 -0400)]
remove stuff about #define

This obscures more than it helps.

Fixes #25573

9 years agofix comments in example about types
Andrew Straw [Tue, 9 Jun 2015 18:49:52 +0000 (20:49 +0200)]
fix comments in example about types

9 years agofix example in comments about demangling
Andrew Straw [Tue, 9 Jun 2015 18:47:51 +0000 (20:47 +0200)]
fix example in comments about demangling

9 years agoDocument str::split behavior with contiguous separators
Steve Klabnik [Tue, 9 Jun 2015 18:42:55 +0000 (14:42 -0400)]
Document str::split behavior with contiguous separators

This can be confusing when whitespace is the separator

Fixes #25986

9 years agoAuto merge of #25995 - alexcrichton:msvc-md, r=brson
bors [Tue, 9 Jun 2015 18:26:26 +0000 (18:26 +0000)]
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.

9 years agoSemantic accuracy in borrow scope rules.
simplex [Tue, 9 Jun 2015 16:08:16 +0000 (13:08 -0300)]
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').

9 years agoImplement Borrow<T> and BorrowMut<T> for Box<T: ?Sized>
Ulrik Sverdrup [Tue, 9 Jun 2015 14:14:48 +0000 (16:14 +0200)]
Implement Borrow<T> and BorrowMut<T> for Box<T: ?Sized>

9 years agoMade ref pattern bindings correctly pick Deref or DerefMut
Marvin Löbel [Sat, 6 Jun 2015 18:10:23 +0000 (20:10 +0200)]
Made ref pattern bindings correctly pick Deref or DerefMut

Added LvaluePreference::from_mutbl

Closes #15609

9 years agoMove collectionstest::char into coretest::char
Simon Sapin [Tue, 9 Jun 2015 09:38:11 +0000 (11:38 +0200)]
Move collectionstest::char into coretest::char

9 years agoFix coretest::char::test_to_uppercase for complex mapping
Simon Sapin [Tue, 9 Jun 2015 09:37:08 +0000 (11:37 +0200)]
Fix coretest::char::test_to_uppercase for complex mapping

9 years agoAuto merge of #26102 - retep998:openoptionsext, r=alexcrichton
bors [Tue, 9 Jun 2015 10:55:04 +0000 (10:55 +0000)]
Auto merge of #26102 - retep998:openoptionsext, r=alexcrichton

r? @alexcrichton

9 years agoAuto merge of #26068 - bluss:bench-sigfigs, r=huonw
bors [Tue, 9 Jun 2015 09:12:09 +0000 (09:12 +0000)]
Auto merge of #26068 - bluss:bench-sigfigs, r=huonw

test: Display benchmark results with thousands separators

Example display:

```
running 9 tests
test a ... bench:           0 ns/iter (+/- 0)
test b ... bench:          52 ns/iter (+/- 0)
test c ... bench:          88 ns/iter (+/- 0)
test d ... bench:         618 ns/iter (+/- 111)
test e ... bench:       5,933 ns/iter (+/- 87)
test f ... bench:      59,280 ns/iter (+/- 1,052)
test g ... bench:     588,672 ns/iter (+/- 3,381)
test h ... bench:   5,894,227 ns/iter (+/- 303,489)
test i ... bench:  59,112,382 ns/iter (+/- 1,500,110)
```

Fixes #10953
Fixes #26109

9 years agoAuto merge of #26098 - russellmcc:add-ar-tool-flexible-target-spec, r=alexcrichton
bors [Tue, 9 Jun 2015 06:03:17 +0000 (06:03 +0000)]
Auto merge of #26098 - russellmcc:add-ar-tool-flexible-target-spec, r=alexcrichton

Looks like this was missed from af56e2efde5cd82564e32598889d25d798c02722.

This will help with defining cross-compile workflows for rust.

9 years agoAuto merge of #25627 - murarth:execution-engine-fix, r=nrc
bors [Tue, 9 Jun 2015 04:28:57 +0000 (04:28 +0000)]
Auto merge of #25627 - murarth:execution-engine-fix, r=nrc

* Removes `RustJITMemoryManager` from public API.
  This was really sort of an implementation detail to begin with.
* `__morestack` is linked to C++ wrapper code and this pointer
  is used when resolving the symbol for `ExecutionEngine` code.
* `__morestack_addr` is also resolved for `ExecutionEngine` code.
  This function is sometimes referenced in LLVM-generated code,
  but was not able to be resolved on Mac OS systems.
* Added Windows support to `ExecutionEngine` API.
* Added a test for basic `ExecutionEngine` functionality.

9 years agoAuto merge of #26117 - Manishearth:rollup, r=Manishearth
bors [Tue, 9 Jun 2015 01:34:24 +0000 (01:34 +0000)]
Auto merge of #26117 - Manishearth:rollup, r=Manishearth

- Successful merges: #25898, #25909, #25948, #25968, #26073, #26078, #26099, #26104, #26105, #26112, #26113
- Failed merges:

9 years agotest: Display benchmark results with thousands separators
Ulrik Sverdrup [Sun, 7 Jun 2015 17:23:56 +0000 (19:23 +0200)]
test: Display benchmark results with thousands separators

Example display:

```
running 9 tests
test a ... bench:           0 ns/iter (+/- 0)
test b ... bench:          52 ns/iter (+/- 0)
test c ... bench:          88 ns/iter (+/- 0)
test d ... bench:         618 ns/iter (+/- 111)
test e ... bench:       5,933 ns/iter (+/- 87)
test f ... bench:      59,280 ns/iter (+/- 1,052)
test g ... bench:     588,672 ns/iter (+/- 3,381)
test h ... bench:   5,894,227 ns/iter (+/- 303,489)
test i ... bench:  59,112,382 ns/iter (+/- 1,500,110)
```

Fixes #10953
Fixes #26109

9 years agoRollup merge of #26113 - tshepang:avoid-abbreviations, r=steveklabnik
Manish Goregaokar [Tue, 9 Jun 2015 00:12:29 +0000 (05:42 +0530)]
Rollup merge of #26113 - tshepang:avoid-abbreviations, r=steveklabnik

9 years agoRollup merge of #26112 - tshepang:readability, r=steveklabnik
Manish Goregaokar [Tue, 9 Jun 2015 00:12:28 +0000 (05:42 +0530)]
Rollup merge of #26112 - tshepang:readability, r=steveklabnik

9 years agoRollup merge of #26105 - tshepang:sentence-not-clear, r=steveklabnik
Manish Goregaokar [Tue, 9 Jun 2015 00:12:28 +0000 (05:42 +0530)]
Rollup merge of #26105 - tshepang:sentence-not-clear, r=steveklabnik