]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agobook: whitespace
Tshepang Lekhonkhobe [Mon, 22 Jun 2015 17:27:31 +0000 (19:27 +0200)]
book: whitespace

9 years agobook: fix sentence
Tshepang Lekhonkhobe [Mon, 22 Jun 2015 17:26:51 +0000 (19:26 +0200)]
book: fix sentence

9 years agoAuto merge of #26221 - sanxiyn:wf-span, r=arielb1
bors [Fri, 12 Jun 2015 18:25:55 +0000 (18:25 +0000)]
Auto merge of #26221 - sanxiyn:wf-span, r=arielb1

When checking field types of struct or enum definitions, use spans for field types instead of the entire item.

9 years agoAuto merge of #26245 - mbrubeck:extern, r=steveklabnik
bors [Fri, 12 Jun 2015 15:15:11 +0000 (15:15 +0000)]
Auto merge of #26245 - mbrubeck:extern, r=steveklabnik

r? @steveklabnik

9 years ago[reference] Fix typo in extern fn section
Matt Brubeck [Fri, 12 Jun 2015 15:08:48 +0000 (08:08 -0700)]
[reference] Fix typo in extern fn section

9 years agoAdd tests for tuple-like structs and dictionary-like enum variants
Seo Sanghyeon [Fri, 12 Jun 2015 12:09:17 +0000 (21:09 +0900)]
Add tests for tuple-like structs and dictionary-like enum variants

9 years agoUse more precise span when checking type definitions
Seo Sanghyeon [Thu, 11 Jun 2015 16:44:42 +0000 (01:44 +0900)]
Use more precise span when checking type definitions

9 years agoAuto merge of #26238 - Manishearth:rollup, r=Manishearth
bors [Fri, 12 Jun 2015 06:25:49 +0000 (06:25 +0000)]
Auto merge of #26238 - Manishearth:rollup, r=Manishearth

- Successful merges: #24495, #26229, #26231
- Failed merges:

9 years agoRollup merge of #26231 - reem:patch-2, r=Gankro
Manish Goregaokar [Fri, 12 Jun 2015 06:25:37 +0000 (11:55 +0530)]
Rollup merge of #26231 - reem:patch-2, r=Gankro

r? @steveklabnik

9 years agoRollup merge of #26229 - Stebalien:versionless-book, r=steveklabnik
Manish Goregaokar [Fri, 12 Jun 2015 06:25:37 +0000 (11:55 +0530)]
Rollup merge of #26229 - Stebalien:versionless-book, r=steveklabnik

They're forever doomed to be out-of-date. Also, don't assume the user is
installing a particular version.

r? @steveklabnik

9 years agoRollup merge of #24495 - nathanl:nathanl-explain-bin-flag, r=steveklabnik
Manish Goregaokar [Fri, 12 Jun 2015 06:25:37 +0000 (11:55 +0530)]
Rollup merge of #24495 - nathanl:nathanl-explain-bin-flag, r=steveklabnik

Explain the --bin flag in terms of the difference
between shipping binary and library code

I'm not sure if my explanation is even quite correct, but as a newbie coming from Ruby, this is my best guess. (In Rubyland, libraries always ship with the source code because there's no other form you can ship. :) )

9 years agoAuto merge of #26224 - mcast:doc-travis2buildbot, r=steveklabnik
bors [Fri, 12 Jun 2015 04:38:02 +0000 (04:38 +0000)]
Auto merge of #26224 - mcast:doc-travis2buildbot, r=steveklabnik

Suggesting this because I was confused by what is now visible from the Travis CI / buildbot split.

Found the hint  in bors comments on d911936d
Couldn't find anything on https://internals.rust-lang.org/

9 years agoAuto merge of #26226 - alexcrichton:fix-msvc-dist, r=brson
bors [Fri, 12 Jun 2015 01:36:55 +0000 (01:36 +0000)]
Auto merge of #26226 - alexcrichton:fix-msvc-dist, r=brson

Right now the distribution tarball for MSVC only includes the *.dll files for
the supporting libraries, but not the corresponding *.lib files which allow
actually linking to the dll. This means that the current MSVC nightlies cannot
produce dynamically linked binaries as the *.lib files are not available to link
against.

This commit modifies the `LIB_GLOB` used to copy the files around to include the
`lib` variant of the `dll`.

9 years agoAuto merge of #26225 - arielb1:raw-self, r=eddyb
bors [Fri, 12 Jun 2015 00:00:27 +0000 (00:00 +0000)]
Auto merge of #26225 - arielb1:raw-self, r=eddyb

This can't be made to work with the current setup.

Technically a [breaking-change], but a simple bug fix.

Fixes #26194.

9 years agoAdd Terminal.com to the list of companies using rust in production.
Jonathan Reem [Thu, 11 Jun 2015 23:07:34 +0000 (16:07 -0700)]
Add Terminal.com to the list of companies using rust in production.

9 years agoAuto merge of #26199 - swgillespie:issue-26092, r=alexcrichton
bors [Thu, 11 Jun 2015 21:35:10 +0000 (21:35 +0000)]
Auto merge of #26199 - swgillespie:issue-26092, r=alexcrichton

`driver::build_output_filenames` calls `file_stem` on a PathBuf obtained from the output file compiler flag. It's possible to pass the empty string to this compiler flag. When file_stem is called on an empty Path, it returns None, which is unwrapped and the compiler panics.

This change modifies the `unwrap` to an `unwrap_or` so that the empty string is passed through the compilation pipeline until it reaches `trans::back::write_output_file`, which will emit an appropriate error.

Instead of panicking, the error that is emitted now is:

```
$ rustc -o "" thing.rs
error: could not write output to : No such file or directory
```

The `:` is a little strange, but it /is/ reporting the filename (the empty string) correctly, I suppose. Both gcc and clang hand the output file to ld, which emits a similar error message when faced with the empty string as an output file:

```
$ clang -o "" thing.c
ld: can't open output file for writing: , errno=2 for architecture x86_64
```

This PR also adds a test for this, in `run-make`. This fixes issue #26092.

9 years agoDon't link to specific versions of rust in the book.
Steven Allen [Thu, 11 Jun 2015 21:30:04 +0000 (17:30 -0400)]
Don't link to specific versions of rust in the book.

They're forever doomed to be out-of-date. Also, don't assume the user is
installing a particular version.

9 years agomk: Tweak the LIB_GLOB for MSVC
Alex Crichton [Thu, 11 Jun 2015 20:50:56 +0000 (13:50 -0700)]
mk: Tweak the LIB_GLOB for MSVC

Right now the distribution tarball for MSVC only includes the *.dll files for
the supporting libraries, but not the corresponding *.lib files which allow
actually linking to the dll. This means that the current MSVC nightlies cannot
produce dynamically linked binaries as the *.lib files are not available to link
against.

This commit modifies the `LIB_GLOB` used to copy the files around to include the
`lib` variant of the `dll`.

9 years agoPrevent raw pointers from being used as an explicit self
Ariel Ben-Yehuda [Thu, 11 Jun 2015 20:45:27 +0000 (23:45 +0300)]
Prevent raw pointers from being used as an explicit self

This can't be made to work with the current setup.

Fixes #26194.

9 years agopoint to buildbot
Matthew Astley [Thu, 11 Jun 2015 09:26:19 +0000 (10:26 +0100)]
point to buildbot

Since 7b6ecc00

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 agoExplain the `--bin` flag more clearly
Nathan Long [Thu, 16 Apr 2015 10:16:52 +0000 (06:16 -0400)]
Explain the `--bin` flag more clearly

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 agofix #26092 by returning an empty OS string when the output file path has no file_stem
swgillespie [Thu, 11 Jun 2015 01:18:04 +0000 (18:18 -0700)]
fix #26092 by returning an empty OS string when the output file path has no file_stem

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