]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoFix links in release notes.
Brian Anderson [Thu, 25 Jun 2015 19:31:06 +0000 (12:31 -0700)]
Fix links in release notes.

My bad!

9 years agoAuto merge of #26542 - GuillaumeGomez:patch-2, r=Manishearth
bors [Thu, 25 Jun 2015 17:21:44 +0000 (17:21 +0000)]
Auto merge of #26542 - GuillaumeGomez:patch-2, r=Manishearth

9 years agoAdd E0327 error code. Thanks @nagisa for his help!
Guillaume Gomez [Wed, 24 Jun 2015 20:32:12 +0000 (22:32 +0200)]
Add E0327 error code. Thanks @nagisa for his help!

9 years agoAuto merge of #26559 - BrodyHolden:ffi-doc-references-std-comm, r=bluss
bors [Thu, 25 Jun 2015 14:53:16 +0000 (14:53 +0000)]
Auto merge of #26559 - BrodyHolden:ffi-doc-references-std-comm, r=bluss

The FFI documentation references std::comm. Replace with std::sync::mpsc.

Also wrap the line.

9 years agoAuto merge of #26558 - nham:fix_24357, r=alexcrichton
bors [Thu, 25 Jun 2015 10:39:09 +0000 (10:39 +0000)]
Auto merge of #26558 - nham:fix_24357, r=alexcrichton

Fixes #24357.

Also adds a (totally separate) regression test, which

Closes #18119

9 years agoAuto merge of #26561 - SimonSapin:remove-titlecase, r=alexcrichton
bors [Thu, 25 Jun 2015 08:24:23 +0000 (08:24 +0000)]
Auto merge of #26561 - SimonSapin:remove-titlecase, r=alexcrichton

I added it because it was easy (same a `char::to_lowercase`, just a different table), but it doesn’t make sense to have this in std but not str::to_titlecase, which would require https://github.com/unicode-rs/unicode-segmentation

At some point in the future this feature will be available (both on char and str) in a crates.io crate.

9 years agoAuto merge of #26563 - sfackler:vec-from-iter-overflow, r=Gankro
bors [Thu, 25 Jun 2015 06:00:15 +0000 (06:00 +0000)]
Auto merge of #26563 - sfackler:vec-from-iter-overflow, r=Gankro

Closes #26550

9 years agoAvoid overflow in Vec::from_iter
Steven Fackler [Thu, 25 Jun 2015 05:47:56 +0000 (22:47 -0700)]
Avoid overflow in Vec::from_iter

Closes #26550

9 years agoRemove char::to_titlecase. Fix #26555
Simon Sapin [Thu, 25 Jun 2015 05:14:27 +0000 (22:14 -0700)]
Remove char::to_titlecase. Fix #26555

I added it because it was easy (same a `char::to_lowercase`,
just a different table), but it doesn’t make sense to have this
in std but not str::to_titlecase, which would require
https://github.com/unicode-rs/unicode-segmentation

At some point in the future this feature will be available
(both on char and str) in a crates.io crate.

9 years agoReplace std::comm reference with std::sync::mpsc.
Brody Holden [Thu, 25 Jun 2015 03:08:55 +0000 (20:08 -0700)]
Replace std::comm reference with std::sync::mpsc.

The FFI documentation references std::comm. Replace with
std::sync::mpsc.

Also wrap the line.

9 years agoAuto merge of #26553 - brson:stddocs, r=Gankro
bors [Thu, 25 Jun 2015 01:54:05 +0000 (01:54 +0000)]
Auto merge of #26553 - brson:stddocs, r=Gankro

"Rust" and "The Rust Standard Library" are capitalized.

9 years agoAdd a regression test for #18119.
Nick Hamann [Thu, 25 Jun 2015 00:29:53 +0000 (19:29 -0500)]
Add a regression test for #18119.

Closes #18119

9 years agoUse correct type for "use of moved value" error with closures.
Nick Hamann [Thu, 25 Jun 2015 00:25:04 +0000 (19:25 -0500)]
Use correct type for "use of moved value" error with closures.

Fixes #24357

9 years agoAuto merge of #26547 - nham:test-19538, r=alexcrichton
bors [Thu, 25 Jun 2015 00:21:33 +0000 (00:21 +0000)]
Auto merge of #26547 - nham:test-19538, r=alexcrichton

Closes #19538.

9 years agoAuto merge of #26539 - jooert:remove_bit_vec_append_splitoff, r=alexcrichton
bors [Wed, 24 Jun 2015 22:49:46 +0000 (22:49 +0000)]
Auto merge of #26539 - jooert:remove_bit_vec_append_splitoff, r=alexcrichton

This seems to have slipped through the cracks in #26192.

r? @alexcrichton

9 years agoFix capitalization in std docs
Brian Anderson [Wed, 24 Jun 2015 21:32:46 +0000 (14:32 -0700)]
Fix capitalization in std docs

"Rust" and "The Rust Standard Library" are capitalized.

9 years agoAuto merge of #26185 - dhuseby:fixing_freebsd_configure, r=brson
bors [Wed, 24 Jun 2015 21:17:00 +0000 (21:17 +0000)]
Auto merge of #26185 - dhuseby:fixing_freebsd_configure, r=brson

On FreeBSD machines without GCC installed, the configure script will now fall back to using clang.

9 years agostupid missing dollar sign
Dave Huseby [Wed, 24 Jun 2015 19:48:08 +0000 (12:48 -0700)]
stupid missing dollar sign

9 years agoAuto merge of #26546 - agrover:add_flock, r=alexcrichton
bors [Wed, 24 Jun 2015 19:44:10 +0000 (19:44 +0000)]
Auto merge of #26546 - agrover:add_flock, r=alexcrichton

flock(2) is in bsd44. Add its fn definition and constants.

9 years agoadding fallback to clang if gcc not available
Dave Huseby [Wed, 10 Jun 2015 18:49:07 +0000 (11:49 -0700)]
adding fallback to clang if gcc not available

9 years agoallowing fallback to clang on freebsd when needed
Dave Huseby [Wed, 10 Jun 2015 18:27:08 +0000 (11:27 -0700)]
allowing fallback to clang on freebsd when needed

9 years agoAdd E0396 error explanation
Guillaume Gomez [Wed, 24 Jun 2015 18:48:12 +0000 (20:48 +0200)]
Add E0396 error explanation

9 years agoAdd E0395 error explanation
Guillaume Gomez [Wed, 24 Jun 2015 18:45:22 +0000 (20:45 +0200)]
Add E0395 error explanation

9 years agoAuto merge of #26536 - frewsxcv:regression-test-22375, r=alexcrichton
bors [Wed, 24 Jun 2015 18:11:39 +0000 (18:11 +0000)]
Auto merge of #26536 - frewsxcv:regression-test-22375, r=alexcrichton

Closes #22375

9 years agoAdd a regression test for #19538.
Nick Hamann [Wed, 24 Jun 2015 17:42:05 +0000 (12:42 -0500)]
Add a regression test for #19538.

Closes #19538.

9 years agoAdd flock() to liblibc
Andy Grover [Wed, 24 Jun 2015 17:21:35 +0000 (10:21 -0700)]
Add flock() to liblibc

9 years agoAuto merge of #26535 - semarie:llvm-version, r=dotdash
bors [Wed, 24 Jun 2015 16:37:59 +0000 (16:37 +0000)]
Auto merge of #26535 - semarie:llvm-version, r=dotdash

LLVM version 3.7 should be supported as external version (when using
--llvm-root configure option), as the current embedded LLVM version is
3.7.0svn.

9 years agoAuto merge of #26533 - nham:test-23305, r=alexcrichton
bors [Wed, 24 Jun 2015 15:05:42 +0000 (15:05 +0000)]
Auto merge of #26533 - nham:test-23305, r=alexcrichton

Closes #23305.

9 years agoAuto merge of #26532 - dhuseby:fixing_bitrig_test_failure, r=alexcrichton
bors [Wed, 24 Jun 2015 13:33:37 +0000 (13:33 +0000)]
Auto merge of #26532 - dhuseby:fixing_bitrig_test_failure, r=alexcrichton

to get the bitrig builder working again.

9 years agoAuto merge of #26529 - steveklabnik:gh26366, r=alexcrichton
bors [Wed, 24 Jun 2015 12:01:35 +0000 (12:01 +0000)]
Auto merge of #26529 - steveklabnik:gh26366, r=alexcrichton

Fixes #26366

9 years agoAuto merge of #26528 - brson:papers, r=alexcrichton
bors [Wed, 24 Jun 2015 10:29:26 +0000 (10:29 +0000)]
Auto merge of #26528 - brson:papers, r=alexcrichton

This adds all papers that mention Rust that I'm aware of. Includes some undergrad work.

9 years agoRemove remaining use of `bit_vec_append_splitoff` feature gate.
Johannes Oertel [Wed, 24 Jun 2015 10:08:10 +0000 (12:08 +0200)]
Remove remaining use of `bit_vec_append_splitoff` feature gate.

9 years agoAuto merge of #26431 - GuillaumeGomez:patch-2, r=Manishearth
bors [Wed, 24 Jun 2015 08:57:34 +0000 (08:57 +0000)]
Auto merge of #26431 - GuillaumeGomez:patch-2, r=Manishearth

Part of #24407.
cc @michaelsproul

9 years agoAdd regression test for #22375
Corey Farwell [Wed, 24 Jun 2015 07:56:53 +0000 (00:56 -0700)]
Add regression test for #22375

Closes #22375

9 years agoAdd missing end of string
Guillaume Gomez [Wed, 24 Jun 2015 07:38:42 +0000 (09:38 +0200)]
Add missing end of string

9 years agoAuto merge of #26527 - brson:bump, r=alexcrichton
bors [Wed, 24 Jun 2015 07:25:19 +0000 (07:25 +0000)]
Auto merge of #26527 - brson:bump, r=alexcrichton

9 years agosupport llvm version 3.7 in configure
Sébastien Marie [Wed, 24 Jun 2015 06:36:42 +0000 (08:36 +0200)]
support llvm version 3.7 in configure

LLVM version 3.7 should be supported as external version (when using
--llvm-root configure option), as the current embedded LLVM version is
3.7.0svn.

9 years agoAuto merge of #26526 - djc:patch-1, r=steveklabnik
bors [Wed, 24 Jun 2015 05:53:19 +0000 (05:53 +0000)]
Auto merge of #26526 - djc:patch-1, r=steveklabnik

In particular, I found that the disclaimer (promised in the second paragraph) doesn't stand out right now. I think the extra headers help with scanning this document, and making it easier to discern which steps are relevant to my particular flow through the options.

9 years agoAuto merge of #26520 - oli-obk:three-tuple-transitive-traits, r=bluss
bors [Wed, 24 Jun 2015 04:21:34 +0000 (04:21 +0000)]
Auto merge of #26520 - oli-obk:three-tuple-transitive-traits, r=bluss

Tuples implement Debug and Hash if their components do.

closes #24826

r? @alexcrichton

cc @steveklabnik

9 years agoAuto merge of #26509 - tshepang:4-and-not-3, r=bluss
bors [Wed, 24 Jun 2015 02:51:13 +0000 (02:51 +0000)]
Auto merge of #26509 - tshepang:4-and-not-3, r=bluss

9 years agoAdd a regression test for #23305.
Nick Hamann [Wed, 24 Jun 2015 02:19:34 +0000 (21:19 -0500)]
Add a regression test for #23305.

Closes #23305.

9 years agoAuto merge of #26521 - oli-obk:android-x86-libclibc, r=alexcrichton
bors [Wed, 24 Jun 2015 01:07:36 +0000 (01:07 +0000)]
Auto merge of #26521 - oli-obk:android-x86-libclibc, r=alexcrichton

All types are same as Android/arm.  So I add condition for Android/x86

closes #25475

r? @alexcrichton

9 years agoAuto merge of #26491 - omasanori:fix-18670, r=brson
bors [Tue, 23 Jun 2015 23:35:47 +0000 (23:35 +0000)]
Auto merge of #26491 - omasanori:fix-18670, r=brson

I've configured with the parameters suggested by @brson in #18670 and confirmed that it works on Gentoo Linux amd64.

Fixes #18670.

9 years agoFix grammar in style guide on traits
Steve Klabnik [Tue, 23 Jun 2015 22:54:16 +0000 (15:54 -0700)]
Fix grammar in style guide on traits

Fixes #26366

9 years agoAuto merge of #26219 - Veedrac:patch-1, r=alexcrichton
bors [Tue, 23 Jun 2015 22:03:04 +0000 (22:03 +0000)]
Auto merge of #26219 - Veedrac:patch-1, r=alexcrichton

Fixes #26196.

Alternatively we could explicitly check and complain (eg. panic), but I don't see the value-add.

9 years agodoc: Add newest Rust papers
Brian Anderson [Tue, 23 Jun 2015 20:59:43 +0000 (13:59 -0700)]
doc: Add newest Rust papers

9 years agoBump to 1.3
Brian Anderson [Tue, 23 Jun 2015 20:32:48 +0000 (13:32 -0700)]
Bump to 1.3

9 years agoAuto merge of #26061 - Gankro:inherit-dep, r=brson
bors [Tue, 23 Jun 2015 20:30:56 +0000 (20:30 +0000)]
Auto merge of #26061 - Gankro:inherit-dep, r=brson

Uncertain if this is the desired effect/strategy/testing.

r? @aturon

9 years agoAdd potential cause of the error
Guillaume Gomez [Tue, 23 Jun 2015 19:16:24 +0000 (21:16 +0200)]
Add potential cause of the error

9 years agoAdd some more headers to installation documentations
Dirkjan Ochtman [Tue, 23 Jun 2015 19:31:07 +0000 (21:31 +0200)]
Add some more headers to installation documentations

In particular, I found that the disclaimer (promised in the second paragraph) doesn't stand out right now. I think the extra headers help with scanning this document, and making it easier to discern which steps are relevant to my particular flow through the options.

9 years agoAuto merge of #26490 - alexcrichton:fix-msvc-again, r=brson
bors [Tue, 23 Jun 2015 18:59:00 +0000 (18:59 +0000)]
Auto merge of #26490 - alexcrichton:fix-msvc-again, r=brson

This commit ensures that the modifications made in #26382 also apply to the
archive commands run in addition to the linker commands.

9 years agothis fixes a bitrig break in the parallel codegen closures test
Dave Huseby [Tue, 23 Jun 2015 18:08:56 +0000 (11:08 -0700)]
this fixes a bitrig break in the parallel codegen closures test

9 years agoReplace example and message by @Manisheart proposition
Guillaume Gomez [Tue, 23 Jun 2015 17:38:40 +0000 (19:38 +0200)]
Replace example and message by @Manisheart proposition

9 years agoAdd E0071 error explanation
Guillaume Gomez [Fri, 19 Jun 2015 14:47:01 +0000 (16:47 +0200)]
Add E0071 error explanation

9 years agoAdd E0044 error code explanation
Guillaume Gomez [Fri, 19 Jun 2015 13:49:08 +0000 (15:49 +0200)]
Add E0044 error code explanation

9 years agoAuto merge of #26508 - tshepang:stray-code-block, r=bluss
bors [Tue, 23 Jun 2015 17:27:07 +0000 (17:27 +0000)]
Auto merge of #26508 - tshepang:stray-code-block, r=bluss

9 years agoAuto merge of #26503 - GuillaumeGomez:patch-4, r=Manishearth
bors [Tue, 23 Jun 2015 15:55:19 +0000 (15:55 +0000)]
Auto merge of #26503 - GuillaumeGomez:patch-4, r=Manishearth

r? @Manishearth

9 years agoAuto merge of #26367 - tshepang:patch-1, r=bluss
bors [Tue, 23 Jun 2015 14:24:10 +0000 (14:24 +0000)]
Auto merge of #26367 - tshepang:patch-1, r=bluss

9 years agoAuto merge of #26354 - jroesch:remove-param-bounds-take-n, r=nikomatsakis
bors [Tue, 23 Jun 2015 12:52:59 +0000 (12:52 +0000)]
Auto merge of #26354 - jroesch:remove-param-bounds-take-n, r=nikomatsakis

This pull request removes `ParamBounds` a old holdover in the type checker that we (@nikomatsakis and I) had wanted to remove. I'm not sure if the current form is the best possible refactor but I figured we can use this as a place to discuss it.

r? @nikomatsakis

9 years agoSupport Android/x86 for liblibc
Makoto Kato [Sat, 16 May 2015 02:10:20 +0000 (11:10 +0900)]
Support Android/x86 for liblibc

All types are same as Android/arm.  So I add condition for Android/x86

9 years agoAuto merge of #26519 - oli-obk:camel_case_const_val, r=eddyb
bors [Tue, 23 Jun 2015 11:20:51 +0000 (11:20 +0000)]
Auto merge of #26519 - oli-obk:camel_case_const_val, r=eddyb

9 years agoAuto merge of #26517 - nrc:fix-parallel-codegen, r=arielb1
bors [Tue, 23 Jun 2015 09:49:03 +0000 (09:49 +0000)]
Auto merge of #26517 - nrc:fix-parallel-codegen, r=arielb1

Closes #26420

r? @nikomatsakis

9 years agotuple.rs: Document more traits implemented by tuples if their components do
Josh Triplett [Sat, 25 Apr 2015 22:15:58 +0000 (15:15 -0700)]
tuple.rs: Document more traits implemented by tuples if their components do

Tuples implement Debug and Hash if their components do.

9 years agochange `const_val` enum and its variants to camel-case
Oliver Schneider [Tue, 23 Jun 2015 08:31:32 +0000 (10:31 +0200)]
change `const_val` enum and its variants to camel-case

9 years agoAuto merge of #26513 - shunyata:master, r=alexcrichton
bors [Tue, 23 Jun 2015 08:18:14 +0000 (08:18 +0000)]
Auto merge of #26513 - shunyata:master, r=alexcrichton

I'm currently reading the rust book and this variable name tripped me up.
Because it was called "input", I thought at first it might contain the line
read by read_line(). This new variable name will be more instructive to rust
beginners.

9 years agoRemove the mostly unecessary ParamBounds struct
Jared Roesch [Tue, 16 Jun 2015 22:53:13 +0000 (15:53 -0700)]
Remove the mostly unecessary ParamBounds struct

9 years agoComment E0222 instead of removing it
Guillaume Gomez [Mon, 22 Jun 2015 20:10:17 +0000 (22:10 +0200)]
Comment E0222 instead of removing it

9 years agoTest for a particular parallel codegen corner case
Nick Cameron [Tue, 23 Jun 2015 06:08:44 +0000 (23:08 -0700)]
Test for a particular parallel codegen corner case

9 years agoFix parallel codegen regression
Nick Cameron [Tue, 23 Jun 2015 05:34:12 +0000 (22:34 -0700)]
Fix parallel codegen regression

Regressed by #26326

9 years agoAuto merge of #26514 - tshepang:repetition, r=Gankro
bors [Tue, 23 Jun 2015 02:32:44 +0000 (02:32 +0000)]
Auto merge of #26514 - tshepang:repetition, r=Gankro

9 years agoAuto merge of #26435 - gsingh93:master, r=nikomatsakis
bors [Tue, 23 Jun 2015 01:00:48 +0000 (01:00 +0000)]
Auto merge of #26435 - gsingh93:master, r=nikomatsakis

When a method exists in an impl but can not be used due to missing trait bounds for the type parameters, we should inform the user which trait bounds are missing.

For example, this code
```
// Note this is missing a Debug impl
struct Foo;

fn main() {
    let a: Result<(), Foo> = Ok(());
    a.unwrap()
}
```
Now gives the following error:
```
/home/gulshan/tmp/tmp.rs:6:7: 6:15 error: no method named `unwrap` found for type `core::result::Result<(), Foo>` in the current scope
/home/gulshan/tmp/tmp.rs:6     a.unwrap()
                                 ^~~~~~~~
/home/gulshan/tmp/tmp.rs:6:7: 6:15 note: The method `unwrap` exists but the following trait bounds were not satisfied: `Foo : core::fmt::Debug`
error: aborting due to previous error
```

Fixes https://github.com/rust-lang/rust/issues/20941.

9 years agodoc: remove repeated word
Tshepang Lekhonkhobe [Tue, 23 Jun 2015 00:48:37 +0000 (02:48 +0200)]
doc: remove repeated word

9 years agoSuggest missing trait bounds when a method exists but the bounds aren't satisfied
Gulshan Singh [Fri, 19 Jun 2015 02:20:45 +0000 (22:20 -0400)]
Suggest missing trait bounds when a method exists but the bounds aren't satisfied

9 years agoUse a more descriptive variable name.
Jake Hickey [Mon, 22 Jun 2015 22:38:19 +0000 (18:38 -0400)]
Use a more descriptive variable name.

I'm currently reading the rust book and this variable name tripped me up.
Because it was called "input", I thought at first it might contain the line
read by read_line(). This new variable name will be more instructive to rust
beginners.

9 years agoAuto merge of #26512 - yongqli:master, r=sfackler
bors [Mon, 22 Jun 2015 22:33:51 +0000 (22:33 +0000)]
Auto merge of #26512 - yongqli:master, r=sfackler

9 years agofix minor indentation issues
Yongqian Li [Mon, 22 Jun 2015 22:30:56 +0000 (15:30 -0700)]
fix minor indentation issues

9 years agoChange description of error (thanks @Manisheart)
Guillaume Gomez [Mon, 22 Jun 2015 16:45:27 +0000 (18:45 +0200)]
Change description of error (thanks @Manisheart)

9 years agoRemove E0222 from errors list
Guillaume Gomez [Mon, 22 Jun 2015 16:39:46 +0000 (18:39 +0200)]
Remove E0222 from errors list

9 years agoAuto merge of #26500 - sanxiyn:dead-field, r=alexcrichton
bors [Mon, 22 Jun 2015 18:42:31 +0000 (18:42 +0000)]
Auto merge of #26500 - sanxiyn:dead-field, r=alexcrichton

Fix #26353.

9 years agobook: there are 4 special sections
Tshepang Lekhonkhobe [Mon, 22 Jun 2015 18:22:31 +0000 (20:22 +0200)]
book: there are 4 special sections

9 years agobook: remove a stray code block
Tshepang Lekhonkhobe [Mon, 22 Jun 2015 18:14:27 +0000 (20:14 +0200)]
book: remove a stray code block

9 years agoAdd E0045 error explanation
Guillaume Gomez [Mon, 22 Jun 2015 16:39:25 +0000 (18:39 +0200)]
Add E0045 error explanation

9 years agoUnify variadic errors
Guillaume Gomez [Mon, 22 Jun 2015 16:34:52 +0000 (18:34 +0200)]
Unify variadic errors

9 years agoAuto merge of #25784 - geofft:subprocess-signal-masks, r=alexcrichton
bors [Mon, 22 Jun 2015 16:11:38 +0000 (16:11 +0000)]
Auto merge of #25784 - geofft:subprocess-signal-masks, r=alexcrichton

UNIX specifies that signal dispositions and masks get inherited to child processes, but in general, programs are not very robust to being started with non-default signal dispositions or to signals being blocked. For example, libstd sets `SIGPIPE` to be ignored, on the grounds that Rust code using libstd will get the `EPIPE` errno and handle it correctly. But shell pipelines are built around the assumption that `SIGPIPE` will have its default behavior of killing the process, so that things like `head` work:

```
geofft@titan:/tmp$ for i in `seq 1 20`; do echo "$i"; done | head -1
1
geofft@titan:/tmp$ cat bash.rs
fn main() {
        std::process::Command::new("bash").status();
}
geofft@titan:/tmp$ ./bash
geofft@titan:/tmp$ for i in `seq 1 20`; do echo "$i"; done | head -1
1
bash: echo: write error: Broken pipe
bash: echo: write error: Broken pipe
bash: echo: write error: Broken pipe
bash: echo: write error: Broken pipe
bash: echo: write error: Broken pipe
[...]
```

Here, `head` is supposed to terminate the input process quietly, but the bash subshell has inherited the ignored disposition of `SIGPIPE` from its Rust grandparent process. So it gets a bunch of `EPIPE`s that it doesn't know what to do with, and treats it as a generic, transient error. You can see similar behavior with `find / | head`, `yes | head`, etc.

This PR resets Rust's `SIGPIPE` handler, as well as any signal mask that may have been set, before spawning a child. Setting a signal mask, and then using a dedicated thread or something like `signalfd` to dequeue signals, is one of two reasonable ways for a library to process signals. See carllerche/mio#16 for more discussion about this approach to signal handling and why it needs a change to `std::process`. The other approach is for the library to set a signal-handling function (`signal()` / `sigaction()`): in that case, dispositions are reset to the default behavior on exec (since the function pointer isn't valid across exec), so we don't have to care about that here.

As part of this PR, I noticed that we had two somewhat-overlapping sets of bindings to signal functionality in `libstd`. One dated to old-IO and probably the old runtime, and was mostly unused. The other is currently used by `stack_overflow.rs`. I consolidated the two bindings into one set, and double-checked them by hand against all supported platforms' headers. This probably means it's safe to enable `stack_overflow.rs` on more targets, but I'm not including such a change in this PR.

r? @alexcrichton
cc @Zoxc for changes to `stack_overflow.rs`

9 years agoDo not consider fields matched by wildcard patterns to be used
Seo Sanghyeon [Mon, 22 Jun 2015 12:36:14 +0000 (21:36 +0900)]
Do not consider fields matched by wildcard patterns to be used

9 years agoAuto merge of #26037 - nhowell:plain_js_playpen, r=steveklabnik
bors [Mon, 22 Jun 2015 05:23:50 +0000 (05:23 +0000)]
Auto merge of #26037 - nhowell:plain_js_playpen, r=steveklabnik

Since the "Book" already avoids jQuery in its inline script tags and playpen.js is tiny, I figured I would convert it to plain old JS as well.

Side note: This is a separate issue, but another thing I noticed in my testing is that the "⇱" character doesn't display correctly in Chrome on Windows 7. (Firefox and IE work fine; other browsers not tested)

r? @steveklabnik

Edit: Github didn't like the "script" tag above
Edit 2: Actually, now IE seems to render "⇱" fine for me. Odd.

9 years agoFix build on Android API levels below 21
Geoffrey Thomas [Thu, 11 Jun 2015 20:23:57 +0000 (16:23 -0400)]
Fix build on Android API levels below 21

signal(), sigemptyset(), and sigaddset() are only available as inline
functions until Android API 21. liblibc already handles signal()
appropriately, so drop it from c.rs; translate sigemptyset() and
sigaddset() (which is only used in a test) by hand from the C inlines.

We probably want to revert this commit when we bump Android API level.

9 years agosys/unix/process: Reset signal behavior before exec
Geoffrey Thomas [Sun, 24 May 2015 02:25:49 +0000 (22:25 -0400)]
sys/unix/process: Reset signal behavior before exec

Make sure that child processes don't get affected by libstd's desire to
ignore SIGPIPE, nor a third-party library's signal mask (which is needed
to use either a signal-handling thread correctly or to use signalfd /
kqueue correctly).

9 years agosys/unix: Consolidate signal-handling FFI bindings
Geoffrey Thomas [Sat, 23 May 2015 22:07:52 +0000 (18:07 -0400)]
sys/unix: Consolidate signal-handling FFI bindings

Both c.rs and stack_overflow.rs had bindings of libc's signal-handling
routines. It looks like the split dated from #16388, when (what is now)
c.rs was in libnative but not libgreen. Nobody is currently using the
c.rs bindings, but they're a bit more accurate in some places.

Move everything to c.rs (since I'll need signal handling in process.rs,
and we should avoid duplication), clean up the bindings, and manually
double-check everything against the relevant system headers (fixing a
few things in the process).

9 years agosys/unix/c.rs: Remove unused code
Geoffrey Thomas [Fri, 22 May 2015 21:30:06 +0000 (17:30 -0400)]
sys/unix/c.rs: Remove unused code

It looks like a lot of this dated to previous incarnations of the io
module, etc., and went unused in the reworking leading up to 1.0. Remove
everything we're not actively using (except for signal handling, which
will be reworked in the next commit).

9 years agostd::process: Remove helper function pwd_cmd from test module
Geoffrey Thomas [Fri, 22 May 2015 20:39:21 +0000 (16:39 -0400)]
std::process: Remove helper function pwd_cmd from test module

The test that used it was removed in 700e627cf727873a472b1876238aac10b932258b.

9 years agoPut CFG_BUILD triples into CFG_HOST triples.
OGINO Masanori [Mon, 22 Jun 2015 03:53:34 +0000 (12:53 +0900)]
Put CFG_BUILD triples into CFG_HOST triples.

I've configured with the parameters suggested by @brson in #18670 and
confirmed that it works on Gentoo Linux amd64.

Fixes #18670.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
9 years agorustc_trans: Use custom PATH for archive commands
Alex Crichton [Mon, 22 Jun 2015 03:47:20 +0000 (20:47 -0700)]
rustc_trans: Use custom PATH for archive commands

This commit ensures that the modifications made in #26382 also apply to the
archive commands run in addition to the linker commands.

9 years agoAuto merge of #26481 - nham:test-18655, r=arielb1
bors [Mon, 22 Jun 2015 01:43:02 +0000 (01:43 +0000)]
Auto merge of #26481 - nham:test-18655, r=arielb1

These issues are fixed but still open.

Closes #18655.
Closes #18988.

9 years agoAuto merge of #26394 - arielb1:implement-rfc401-part2, r=nrc
bors [Mon, 22 Jun 2015 00:11:00 +0000 (00:11 +0000)]
Auto merge of #26394 - arielb1:implement-rfc401-part2, r=nrc

This makes them compliant with the new version of RFC 401 (i.e.
    RFC 1052).

Fixes #26391. I *hope* the tests I have are enough.

This is a [breaking-change]

r? @nrc

9 years agoAuto merge of #26479 - arielb1:expr-kind, r=eddyb
bors [Sun, 21 Jun 2015 22:41:00 +0000 (22:41 +0000)]
Auto merge of #26479 - arielb1:expr-kind, r=eddyb

Previously it also tried to find out the best way to translate the
expression, which could ICE during type-checking.

Fixes #23173
Fixes #24322
Fixes #25757

r? @eddyb

9 years agoAuto merge of #26463 - sfackler:stdout-panic-fix, r=alexcrichton
bors [Sun, 21 Jun 2015 20:14:45 +0000 (20:14 +0000)]
Auto merge of #26463 - sfackler:stdout-panic-fix, r=alexcrichton

If a local stderr is present but the normal stderr is missing, we still
want to print.

r? @alexcrichton

9 years agoAdd regression tests for issues #18655 and #18988.
Nick Hamann [Sun, 21 Jun 2015 19:16:12 +0000 (14:16 -0500)]
Add regression tests for issues #18655 and #18988.

Closes #18655.
Closes #18988.

9 years agoMake expr_is_lval more robust
Ariel Ben-Yehuda [Sun, 21 Jun 2015 19:29:13 +0000 (22:29 +0300)]
Make expr_is_lval more robust

Previously it also tried to find out the best way to translate the
expression, which could ICE during type-checking.

Fixes #23173
Fixes #24322
Fixes #25757

9 years agoAuto merge of #25641 - geofft:execve-const, r=alexcrichton
bors [Sun, 21 Jun 2015 17:45:01 +0000 (17:45 +0000)]
Auto merge of #25641 - geofft:execve-const, r=alexcrichton

The `execv` family of functions and `getopt` are prototyped somewhat strangely in C: they take a `char *const argv[]` (and `envp`, for `execve`), an immutable array of mutable C strings -- in other words, a `char *const *argv` or `argv: *const *mut c_char`. The current Rust binding uses `*mut *const c_char`, which is backwards (a mutable array of constant C strings).

That said, these functions do not actually modify their arguments. Once upon a time, C didn't have `const`, and to this day, string literals in C have type `char *` (`*mut c_char`). So an array of string literals has type `char * []`, equivalent to `char **` in a function parameter (Rust `*mut *mut c_char`). C allows an implicit cast from `T **` to `T * const *` (`*const *mut T`) but not to `const T * const *` (`*const *const T`). Therefore, prototyping `execv` as taking `const char * const argv[]` would have broken existing code (by requiring an explicit cast), despite being more correct. So, even though these functions don't need mutable data, they're prototyped as if they do.

While it's theoretically possible that an implementation could choose to use its freedom to modify the mutable data, such an implementation would break the innumerable users of `execv`-family functions that call them with string literals. Such an implementation would also break `std::process`, which currently works around this with an unsafe `as *mut _` cast, and assumes that `execvp` secretly does not modify its argument. Furthermore, there's nothing useful to be gained by being able to write to the strings in `argv` themselves but not being able to write to the array containing those strings (you can't reorder arguments, add arguments, increase the length of any parameter, etc.).

So, despite the C prototype with its legacy C problems, it's simpler for everyone for Rust to consider these functions as taking `*const *const c_char`, and it's also safe to do so. Rust does not need to expose the mistakes of C here. This patch makes that change, and drops the unsafe cast in `std::process` since it's now unnecessary.