Commit Graph

52284 Commits

Author SHA1 Message Date
Kaiyin Zhong
f91649144e remove "#" symbols to make the code compile 2016-04-15 00:51:20 +02:00
bors
073a09fd63 Auto merge of #32908 - oli-obk:hygienic_derive_encodable, r=alexcrichton
prevent other `encode` methods from breaking `derive(RustcEncodable)`

fixes https://github.com/rust-lang-nursery/rustc-serialize/issues/151
2016-04-14 08:23:11 -07:00
bors
fbf8a8ce5e Auto merge of #32892 - brson:relnotes19, r=alexcrichton
Release notes for 1.9
2016-04-14 05:58:25 -07:00
bors
c9f15013e0 Auto merge of #32883 - sanxiyn:nameless-defkey, r=arielb1
Do not encode name when encoding DefKey

Since name is encoded anyway, name in DefKey is redundant.

cc #32719.
2016-04-14 03:49:14 -07:00
bors
374d262b3a Auto merge of #32718 - timonvo:bootstrap-skip-docs, r=alexcrichton
rustbuild: Skip generating docs if the config disables them.

r? @alexcrichton
2016-04-14 00:38:58 -07:00
bors
0cb2ee2ef6 Auto merge of #32877 - oli-obk:const_err_multi, r=arielb1
don't report errors in constants at every use site

partially fixes #32842

r? @arielb1
cc @retep998

I chose this way of implementing it, because the alternative (checking if the error span is inside the constant's expressions's span) would get confusing when combined with expression generating macros.

A next step would be to re-enable the re-reporting of errors if the original erroneous constant is in another crate.
2016-04-13 22:33:10 -07:00
Timon Van Overveldt
2805e83dcb rustbuild: Skip generating docs if the config disables them.
It looks like before these config variables weren't actually taken
into account. This patch should make the build system skip over the
documentation steps correctly.
2016-04-13 18:36:58 -07:00
bors
adb0923492 Auto merge of #32944 - alexcrichton:add-to-gitignore, r=brson
Add /obj/ to .gitignore

This is the build directory our buildbots use, and right now the bots are
running `git clean -f -f -d` to remove all untracked files between runs and this
is accidentally deleting `obj`, so we're building LLVM a lot.

Hopefully this keeps the bots caching `obj` so we can clean it out manually and
leave LLVM around.
2016-04-13 17:50:12 -07:00
Alex Crichton
de1838148c Add /obj/ to .gitignore
This is the build directory our buildbots use, and right now the bots are
running `git clean -f -f -d` to remove all untracked files between runs and this
is accidentally deleting `obj`, so we're building LLVM a lot.

Hopefully this keeps the bots caching `obj` so we can clean it out manually and
leave LLVM around.
2016-04-13 17:46:01 -07:00
bors
2b60207231 Auto merge of #32592 - tbu-:pr_range_from_overflow, r=alexcrichton
Add a note about overflowing in the `RangeFrom` iterator
2016-04-13 14:26:10 -07:00
bors
35dca7fb7b Auto merge of #32780 - soltanmm:consider-the-following, r=nikomatsakis
Replace consider_unification_despite_ambiguity with new obligation variant

Is work towards #32730. Addresses part one of #32286. Addresses #24210 and #26046 to some degree.

r? @nikomatsakis
2016-04-13 11:28:30 -07:00
Tobias Bucher
6acd90f0c9 Add a note about overflowing in the RangeFrom iterator 2016-04-13 20:09:15 +02:00
Masood Malekghassemi
de82fc4dc6 Fix obscure compilation error 2016-04-13 07:48:53 -07:00
bors
525aa61022 Auto merge of #32828 - vadimcn:symlinks, r=alexcrichton
Do not rely on file extensions after path canonicalization.

Rustc does not recognize libraries which are symlinked to files having extension other than .rlib. The problem is that find_library_crate calls fs::canonicalize on found library paths, but then the resulting path is passed to get_metadata_section, which assumes it will end in ".rlib" if it's an rlib (from https://internals.rust-lang.org/t/is-library-path-canonicalization-worth-it/3206).

cc #29433
2016-04-13 07:16:20 -07:00
bors
6136a86291 Auto merge of #32817 - jseyfried:warn_impl_param_defaults, r=nikomatsakis
Warn for type parameter defaults on impl blocks

Warn for type parameter defaults on impl blocks (fixes #31543).
r? @nikomatsakis
2016-04-13 04:18:36 -07:00
bors
7d4d3cb0be Auto merge of #32726 - asomers:master, r=alexcrichton
Fix stack overflow detection on FreeBSD
2016-04-13 01:20:15 -07:00
bors
4b71f8d141 Auto merge of #32814 - jseyfried:improve_duplicate_glob_detection, r=nikomatsakis
resolve: Improve duplicate glob detection

This fixes a bug introduced in #31726 in which we erroneously allow multiple imports of the same item under some circumstances.

More specifically, we erroneously allow a module that is in a cycle of glob re-exports to have other re-exports (besides the glob from the cycle).
For example,
```rust
pub fn f() {}
mod foo {
    pub use f; // (1) This defines `foo::f`.
    pub use bar::*; // (3) This also defines `foo::f`, which should be a duplicate error but is currently allowed.
}
mod bar {
    pub use foo::*; // (2) This defines `bar::f`.
}
```

A module in a glob re-export cycle can still have `pub` items after this PR. For example,
```rust
mod foo {
    pub fn f() {}; // (1) This defines `foo::f`.
    pub use bar::*; // (3) This is not a duplicate error since items shadow glob-imported re-exports (cf #31337).
}
mod bar {
    pub use foo::*; // (2) This defines `bar::f`.
}
```
r? @nikomatsakis
2016-04-12 22:21:23 -07:00
bors
7c27cce9e5 Auto merge of #32803 - eddyb:mir-debuginfo, r=nikomatsakis
Initial implementation of debuginfo in MIR trans.

Progress is made towards #31005, but several issues remain, such as #32790.
2016-04-12 19:22:32 -07:00
bors
a43eb4e774 Auto merge of #32590 - alexcrichton:rustbuild-tidy-checks, r=brson
rustbuild: Migrate tidy checks to Rust

This commit rewrites all of the tidy checks we have, namely:

* featureck
* errorck
* tidy
* binaries

into Rust under a new `tidy` tool inside of the `src/tools` directory. This at
the same time deletes all the corresponding Python tidy checks so we can be sure
to only have one source of truth for all the tidy checks.

cc #31590
2016-04-12 16:24:33 -07:00
Alex Crichton
7bfaeaaf9c tidy: Add a check to ensure Cargo.toml is in sync
This verifies that the crates listed in the `[dependencies]` section of
`Cargo.toml` are a subset of the crates listed in `lib.rs` for our in-tree
crates. This should help ensure that when we refactor crates over time we keep
these dependency lists in sync.
2016-04-12 15:55:14 -07:00
Brian Anderson
bbcfcfc61d Release notes for 1.9 2016-04-12 21:23:44 +00:00
bors
a4f781e477 Auto merge of #31963 - barosl:rename-doc, r=alexcrichton
Describe more platform-specific behaviors of `std::fs::rename`

I did some tests myself regarding the situation when both `from` and `to` exist, and the results were:

On Linux:

`from` | `to` | Result
---- | ---- | ----
Directory | Directory | Ok
Directory | File | Error
File | Directory | Error
File | File | Ok

On Windows:

`from` | `to` | Result
---- | ---- | ----
Directory | Directory | Error
Directory | File | Ok
File | Directory | Error
File | File | Ok

This is a bit against the official MSDN documentation, which says "(`MOVEFILE_REPLACE_EXISTING`) cannot be used if `lpNewFileName` or `lpExistingFileName` names a directory." As evidenced above, `lpExistingFileName` *can* be a directory.

I also mentioned the atomicity of the operation.

Fixes #31301.
2016-04-12 10:12:55 -07:00
Alex Crichton
9dd3c54a2c rustbuild: Migrate tidy checks to Rust
This commit rewrites all of the tidy checks we have, namely:

* featureck
* errorck
* tidy
* binaries

into Rust under a new `tidy` tool inside of the `src/tools` directory. This at
the same time deletes all the corresponding Python tidy checks so we can be sure
to only have one source of truth for all the tidy checks.

cc #31590
2016-04-12 08:17:42 -07:00
bors
933000613b Auto merge of #32811 - alexcrichton:check-lints, r=nrc
rustdoc: Fix testing no_run code blocks

This was a regression introduced by #31250 where the compiler deferred returning
the results of compilation a little too late (after the `Stop` check was looked
at). This commit alters the stop point to first try to return an erroneous
`result` and only if it was successful return the sentinel `Err(0)`.

Closes #31576
2016-04-12 07:14:55 -07:00
Oliver Schneider
2fd2210b88 prevent other encode methods from breaking derive(RustcEncodable) 2016-04-12 15:41:46 +02:00
bors
bed32d83fc Auto merge of #32804 - alexcrichton:stabilize-1.9, r=brson
std: Stabilize APIs for the 1.9 release

This commit applies all stabilizations, renamings, and deprecations that the
library team has decided on for the upcoming 1.9 release. All tracking issues
have gone through a cycle-long "final comment period" and the specific APIs
stabilized/deprecated are:

Stable

* `std::panic`
* `std::panic::catch_unwind` (renamed from `recover`)
* `std::panic::resume_unwind` (renamed from `propagate`)
* `std::panic::AssertUnwindSafe` (renamed from `AssertRecoverSafe`)
* `std::panic::UnwindSafe` (renamed from `RecoverSafe`)
* `str::is_char_boundary`
* `<*const T>::as_ref`
* `<*mut T>::as_ref`
* `<*mut T>::as_mut`
* `AsciiExt::make_ascii_uppercase`
* `AsciiExt::make_ascii_lowercase`
* `char::decode_utf16`
* `char::DecodeUtf16`
* `char::DecodeUtf16Error`
* `char::DecodeUtf16Error::unpaired_surrogate`
* `BTreeSet::take`
* `BTreeSet::replace`
* `BTreeSet::get`
* `HashSet::take`
* `HashSet::replace`
* `HashSet::get`
* `OsString::with_capacity`
* `OsString::clear`
* `OsString::capacity`
* `OsString::reserve`
* `OsString::reserve_exact`
* `OsStr::is_empty`
* `OsStr::len`
* `std::os::unix::thread`
* `RawPthread`
* `JoinHandleExt`
* `JoinHandleExt::as_pthread_t`
* `JoinHandleExt::into_pthread_t`
* `HashSet::hasher`
* `HashMap::hasher`
* `CommandExt::exec`
* `File::try_clone`
* `SocketAddr::set_ip`
* `SocketAddr::set_port`
* `SocketAddrV4::set_ip`
* `SocketAddrV4::set_port`
* `SocketAddrV6::set_ip`
* `SocketAddrV6::set_port`
* `SocketAddrV6::set_flowinfo`
* `SocketAddrV6::set_scope_id`
* `<[T]>::copy_from_slice`
* `ptr::read_volatile`
* `ptr::write_volatile`
* The `#[deprecated]` attribute
* `OpenOptions::create_new`

Deprecated

* `std::raw::Slice` - use raw parts of `slice` module instead
* `std::raw::Repr` - use raw parts of `slice` module instead
* `str::char_range_at` - use slicing plus `chars()` plus `len_utf8`
* `str::char_range_at_reverse` - use slicing plus `chars().rev()` plus `len_utf8`
* `str::char_at` - use slicing plus `chars()`
* `str::char_at_reverse` - use slicing plus `chars().rev()`
* `str::slice_shift_char` - use `chars()` plus `Chars::as_str`
* `CommandExt::session_leader` - use `before_exec` instead.

Closes #27719
cc #27751 (deprecating the `Slice` bits)
Closes #27754
Closes #27780
Closes #27809
Closes #27811
Closes #27830
Closes #28050
Closes #29453
Closes #29791
Closes #29935
Closes #30014
Closes #30752
Closes #31262
cc #31398 (still need to deal with `before_exec`)
Closes #31405
Closes #31572
Closes #31755
Closes #31756
2016-04-12 04:17:36 -07:00
Barosl Lee
bcbc9e5346 Describe more platform-specific behaviors of std::fs::rename
Fixes #31301.
2016-04-12 15:12:39 +09:00
bors
28c9fdafc0 Auto merge of #32711 - marcusklaas:try-shorthand-span-fix, r=nagisa
Fix the span for try shorthand expressions

My five character contribution to the rust parser! Fixes https://github.com/rust-lang/rust/issues/32709.
2016-04-11 22:14:04 -07:00
bors
c0221c8897 Auto merge of #32882 - steveklabnik:rollup, r=steveklabnik
Rollup of 9 pull requests

- Successful merges: #32768, #32802, #32815, #32823, #32849, #32854, #32862, #32870, #32873
- Failed merges:
2016-04-11 13:20:56 -07:00
Jeffrey Seyfried
bc6daea2db Add regression test for #32797 (fixes #32797) 2016-04-11 19:42:33 +00:00
Marcus Klaas
05e4116af2 Fix the span for try shorthand expressions 2016-04-11 21:22:37 +02:00
Jeffrey Seyfried
3238b4bbbd Add comments 2016-04-11 18:30:48 +00:00
Eduard Burtescu
373b6ec935 tests: update for MIR debuginfo. 2016-04-11 20:51:45 +03:00
Eduard Burtescu
ce8d4a2134 trans: initial implementation of MIR debuginfo. 2016-04-11 20:51:45 +03:00
Eduard Burtescu
f680c623d4 mir: store the span of a scope in the ScopeData. 2016-04-11 20:49:07 +03:00
Eduard Burtescu
4e6b178649 trans: use DefKey directly in debuginfo for paths. 2016-04-11 20:49:07 +03:00
Eduard Burtescu
e945b2852e trans: pass essential information from trans_closure to debuginfo. 2016-04-11 20:49:07 +03:00
Eduard Burtescu
35a6e6a02b trans: use Instance in trans_closure and FunctionContext::new. 2016-04-11 20:49:07 +03:00
Eduard Burtescu
a563711b6a mir: print the scope and span for variables. 2016-04-11 20:49:07 +03:00
Seo Sanghyeon
2fd1f3e24a Do not encode name when encoding DefKey 2016-04-12 01:35:26 +09:00
Alex Crichton
42bcb4047d rustdoc: Fix testing no_run code blocks
This was a regression introduced by #31250 where the compiler deferred returning
the results of compilation a little too late (after the `Stop` check was looked
at). This commit alters the stop point to first try to return an erroneous
`result` and only if it was successful return the sentinel `Err(0)`.

Closes #31576
2016-04-11 09:26:59 -07:00
Alex Crichton
552eda70d3 std: Stabilize APIs for the 1.9 release
This commit applies all stabilizations, renamings, and deprecations that the
library team has decided on for the upcoming 1.9 release. All tracking issues
have gone through a cycle-long "final comment period" and the specific APIs
stabilized/deprecated are:

Stable

* `std::panic`
* `std::panic::catch_unwind` (renamed from `recover`)
* `std::panic::resume_unwind` (renamed from `propagate`)
* `std::panic::AssertUnwindSafe` (renamed from `AssertRecoverSafe`)
* `std::panic::UnwindSafe` (renamed from `RecoverSafe`)
* `str::is_char_boundary`
* `<*const T>::as_ref`
* `<*mut T>::as_ref`
* `<*mut T>::as_mut`
* `AsciiExt::make_ascii_uppercase`
* `AsciiExt::make_ascii_lowercase`
* `char::decode_utf16`
* `char::DecodeUtf16`
* `char::DecodeUtf16Error`
* `char::DecodeUtf16Error::unpaired_surrogate`
* `BTreeSet::take`
* `BTreeSet::replace`
* `BTreeSet::get`
* `HashSet::take`
* `HashSet::replace`
* `HashSet::get`
* `OsString::with_capacity`
* `OsString::clear`
* `OsString::capacity`
* `OsString::reserve`
* `OsString::reserve_exact`
* `OsStr::is_empty`
* `OsStr::len`
* `std::os::unix::thread`
* `RawPthread`
* `JoinHandleExt`
* `JoinHandleExt::as_pthread_t`
* `JoinHandleExt::into_pthread_t`
* `HashSet::hasher`
* `HashMap::hasher`
* `CommandExt::exec`
* `File::try_clone`
* `SocketAddr::set_ip`
* `SocketAddr::set_port`
* `SocketAddrV4::set_ip`
* `SocketAddrV4::set_port`
* `SocketAddrV6::set_ip`
* `SocketAddrV6::set_port`
* `SocketAddrV6::set_flowinfo`
* `SocketAddrV6::set_scope_id`
* `<[T]>::copy_from_slice`
* `ptr::read_volatile`
* `ptr::write_volatile`
* The `#[deprecated]` attribute
* `OpenOptions::create_new`

Deprecated

* `std::raw::Slice` - use raw parts of `slice` module instead
* `std::raw::Repr` - use raw parts of `slice` module instead
* `str::char_range_at` - use slicing plus `chars()` plus `len_utf8`
* `str::char_range_at_reverse` - use slicing plus `chars().rev()` plus `len_utf8`
* `str::char_at` - use slicing plus `chars()`
* `str::char_at_reverse` - use slicing plus `chars().rev()`
* `str::slice_shift_char` - use `chars()` plus `Chars::as_str`
* `CommandExt::session_leader` - use `before_exec` instead.

Closes #27719
cc #27751 (deprecating the `Slice` bits)
Closes #27754
Closes #27780
Closes #27809
Closes #27811
Closes #27830
Closes #28050
Closes #29453
Closes #29791
Closes #29935
Closes #30014
Closes #30752
Closes #31262
cc #31398 (still need to deal with `before_exec`)
Closes #31405
Closes #31572
Closes #31755
Closes #31756
2016-04-11 08:57:53 -07:00
Steve Klabnik
55e90bbd5e Rollup merge of #32873 - jethrogb:patch-2, r=steveklabnik
Match signed/unsigned integer type docs

* Copy documentation from signed implementation to unsigned implementation, where necessary.

A few functions had elaborate docs in the signed version but not in the unsigned version. This probably happenned because the signed version is at the top and the author didn't realize they had to update the documentation in both locations.

* Use signed integers in signed documentation, where possible.

r? @steveklabnik
2016-04-11 10:31:28 -04:00
Steve Klabnik
24c5c27702 Rollup merge of #32870 - jethrogb:patch-1, r=GuillaumeGomez
Fix Windows UNC paths in std::path docs
2016-04-11 10:31:28 -04:00
Steve Klabnik
c5842837b8 Rollup merge of #32862 - raphlinus:master, r=bluss
Bit-magic for faster is_char_boundary

The asm generated for b < 128 || b >= 192 is not ideal, as it computes
both sub-inequalities. This patch replaces it with bit magic.

Fixes #32471
2016-04-11 10:31:28 -04:00
Steve Klabnik
7ba7e02b5e Rollup merge of #32854 - GuillaumeGomez:result_doc, r=steveklabnik
Add some missing commas and missing titles/formatting

Fixes #29373.

r? @steveklabnik
2016-04-11 10:31:28 -04:00
Steve Klabnik
c9c850997e Rollup merge of #32849 - jseyfried:import_resolution_diagnostics, r=eddyb
resolve: import resolution diagnostics

This improves the diagnostics for failing import resolutions (fixes #32833).
r? @eddyb
2016-04-11 10:31:28 -04:00
Steve Klabnik
9989a95fd2 Rollup merge of #32823 - pravic:target-json, r=alexcrichton
Read "is-like-msvc" target option from JSON

This is in reference to #32818.
2016-04-11 10:31:27 -04:00
Steve Klabnik
b5fc27cc81 Rollup merge of #32815 - allonsy:master, r=GuillaumeGomez
Adds data race in docs

Thanks for all your hard work!
This is in reference to #32733
I know there has been a discussion about this on PR #32538 so you are welcome to keep the code as is or merge my documentation in.
Let me know what you think and/or if you want me to modify anything!
2016-04-11 10:31:27 -04:00
Steve Klabnik
47cc036948 Rollup merge of #32802 - nikomatsakis:issue-32505, r=eddyb
add regression test for #32505

Fixes #32505

r? @eddyb
2016-04-11 10:31:27 -04:00