Commit Graph

59595 Commits

Author SHA1 Message Date
Alex Crichton a7710eff06 Rollup merge of #38315 - jonhoo:better-E0309, r=pnkfelix
Expand E0309 explanation with motivating example

I recently started reading @Gankro's "[Learning Rust With Entirely Too Many Linked Lists](http://cglab.ca/~abeinges/blah/too-many-lists/book/README.html)", and came across [a part](http://cglab.ca/~abeinges/blah/too-many-lists/book/second-iter.html) where he comes across `E0309`, and after showing `rustc --explain E0309` prompty says

> This is dumb. I think it's dumb. You have to do it.

Humor aside, I think this says something about the current explanation being somewhat lacking.

This patch introduces a motivating example saying why `T: 'a` is a necessary restriction. Hopefully, this will help new Rustaceans understand why leaving out the `'a` bound on `T` might lead to broken code.
2016-12-20 12:59:02 -08:00
Alex Crichton dfa9948d76 Rollup merge of #38289 - bluss:mir-verbose-test-fail, r=michaelwoerister
A more verbose matching failure for mir tests

This makes it easier to work with mir test failures during development.

- Show which expected line was not found
- Show full expected output
- Show full actual output
2016-12-20 11:16:30 -08:00
Alex Crichton 2f4ca4e2df Rollup merge of #38245 - estebank:cast-deref-hint-2, r=nikomatsakis
When cast needs a dereference point at full cast

After the fix of #37453 in PR #37369, instead of pointing at only the cast type, point at the full cast span when a cast needs a dereference, as well as assign the error label to the correct span for proper coloring:

<img width="471" alt="error span pointing at the entire cast" src="https://cloud.githubusercontent.com/assets/1606434/21024245/8797fc2e-bd38-11e6-82c1-66c281c656c1.png">

instead of

<img width="471" alt="error span pointing at the type of the cast" src="https://cloud.githubusercontent.com/assets/1606434/21023777/d4814aa6-bd36-11e6-9fc3-b2a0ea5ee15d.png">

Move `compile-fail` test to `ui` test.
2016-12-20 11:16:29 -08:00
Alex Crichton 4cfb2b48fe Rollup merge of #38236 - GuillaumeGomez:unix_socket_doc, r=frewsxcv
Unix socket doc

r? @frewsxcv
2016-12-20 11:16:26 -08:00
Alex Crichton 70e1275a1a Rollup merge of #38215 - liigo:patch-12, r=petrochenkov
minor fix about visibility in reference
2016-12-20 11:16:25 -08:00
Alex Crichton b070feb440 Rollup merge of #38208 - frewsxcv:btreesetdocs, r=alexcrichton
Improvements to `BTreeSet` documentation.

None
2016-12-20 11:16:24 -08:00
Alex Crichton 551cb0646f Rollup merge of #38171 - jseyfried:cleanup, r=nrc
Miscellaneous cleanup/refactoring in `resolve` and `syntax::ext`

r? @nrc
2016-12-20 11:16:23 -08:00
Alex Crichton 58d58c24dc Rollup merge of #38158 - sourcefrog:doc-iter, r=GuillaumeGomez
Explain meaning of Result iters and link to factory functions
2016-12-20 11:16:22 -08:00
Alex Crichton 2fb2d307e0 Rollup merge of #38150 - estebank:fix-23286, r=nikomatsakis
Point out the known type when field doesn't satisfy bound

For file

```rust
use std::path::Path;

fn f(p: Path) { }
```

provide the following error

```nocode
error[E0277]: the trait bound `[u8]: std::marker::Sized` is not satisfied in `std::path::Path`
 --> file.rs:3:6
  |
3 | fn f(p: Path) { }
  |      ^ within `std::path::Path`, the trait `std::marker::Sized` is not implemented for `[u8]`
  |
  = note: `[u8]` does not have a constant size known at compile-time
  = note: required because it appears within the type `std::path::Path`
  = note: all local variables must have a statically known size
```

Fix #23286.
2016-12-20 11:16:20 -08:00
Alex Crichton 65e9691cef Rollup merge of #38131 - clarcharr:from_segments, r=alexcrichton
Add From<[u16; 8]> to Ipv6Addr

Not really sure that this requires an RFC, but I figured that I'd offer a pull request and see what people think. It seems like a reasonable addition.
2016-12-20 11:16:19 -08:00
Alex Crichton 68dd6fd964 Rollup merge of #38006 - frewsxcv:libstd-debug, r=alexcrichton
Implement `fmt::Debug` for all structures in libstd.

Part of https://github.com/rust-lang/rust/issues/31869.

Also turn on the `missing_debug_implementations` lint at the crate
level.
2016-12-20 11:16:17 -08:00
Alex Crichton 7fe44f77f4 Rollup merge of #37761 - christophebiocca:borrow-stdlib-fn-refactor, r=alexcrichton
Use Borrow for binary_search and contains methods in the standard library

Fixes all standard library methods in #32822 that can be fixed without backwards compatibility issues.
2016-12-20 11:16:17 -08:00
Corey Farwell fe0d0927f7 Indicate that `BTreeSet::iter` returns values in ascending order.
Fixes https://github.com/rust-lang/rust/issues/38204.
2016-12-20 10:44:33 -08:00
Jeffrey Seyfried f705c69bf6 Simplify `TyCtxt::create_and_enter`. 2016-12-19 20:57:03 +00:00
Jeffrey Seyfried 39e6ae2dcc Clean up `get_traits_containing_item`. 2016-12-19 20:57:02 +00:00
Jeffrey Seyfried 8d9ba291f5 Minor bugfix for macro invocation path resolution. 2016-12-19 20:57:02 +00:00
Jeffrey Seyfried 51f25b3cfc resolve: clean up diagnostics for name conflicts. 2016-12-19 20:57:02 +00:00
Jeffrey Seyfried 8e61ff25d8 Optimize `ast::PathSegment`. 2016-12-19 20:57:00 +00:00
bors 94ae2a2e67 Auto merge of #38072 - nikomatsakis:bootstrap-incremental, r=acrichto
add preliminary support for incremental compilation to rustbuild.py

This implements the integration described in #37929. It requires the use of a local nightly as your bootstrap compiler. The setup is described in `src/bootstrap/README.md`.

This does NOT implement the "copy stage0 libs to stage1" optimization described in #37929, just because that seems orthogonal to me.

In local testing, I do not yet see any incremental re-use when building rustc. I'm not sure why that is, more investigation needed.

(For these reasons, this is not marked as fixing the relevant issue.)

r? @alexcrichton -- I included one random cleanup (`Step::noop()`) that turned out to not be especially relevant. Feel free to tell me you liked it better the old way.
2016-12-19 20:07:49 +00:00
Niko Matsakis 83453bc673 add and document `--incremental` flag along with misc other changes
For example:

- we now support `-vv` to get very verbose output.
- RUSTFLAGS is respected by `x.py`
- better error messages for some cases
2016-12-19 11:46:38 -05:00
Niko Matsakis ef8921add6 add concept of `Step::noop()` 2016-12-19 11:46:03 -05:00
bors 3f9823d5f5 Auto merge of #38405 - alexcrichton:rustbuild-fixes, r=japaric
rustbuild: Fix `copy` helper with existing files

This erroneously truncated files when the destination already existed and was an
existing hard link to the source. This in turn caused weird bugs!

Closes #37745
2016-12-19 15:36:15 +00:00
bors 10271ea24f Auto merge of #38466 - sanxiyn:rollup, r=sanxiyn
Rollup of 9 pull requests

- Successful merges: #38334, #38397, #38413, #38421, #38422, #38433, #38438, #38445, #38459
- Failed merges:
2016-12-19 12:17:24 +00:00
Seo Sanghyeon 05be48b18b Rollup merge of #38459 - nagisa:rustbuild-exec, r=alexcrichton
Use exec for the wrapper on UNIXes

This not only avoids the small – and unnecessary – constant overhead for each compiler invocation,
but also helps somewhat by only having “correct” rustc processes to look for in `/proc/`.

This also makes the wrapper behave effectively as a regular exec wrapper its intended to be.

I also took liberty to change the fallback error code from `1` to `0xfe` (now only relevant on windows) so that when people complain about “compiler exited with code 254”, its obvious where the issue lies (wrapper losing the exit code somehow).

r? @alexcrichton
2016-12-19 16:59:44 +09:00
Seo Sanghyeon fda41c6b5c Rollup merge of #38445 - est31:master, r=apasel422
stage0.txt: typo fix
2016-12-19 16:59:44 +09:00
Seo Sanghyeon 9f18f25464 Rollup merge of #38438 - alexcrichton:update-beta, r=brson
Update beta bootstrap compiler

The current beta that rustc is bootstrapping from contains a bug in Cargo that
erroneously links to OpenSSL in /usr/local, but this is fixed in the most recent
1.14 beta, so let's use that.
2016-12-19 16:59:43 +09:00
Seo Sanghyeon 49cd809e7a Rollup merge of #38433 - GuillaumeGomez:thread_docs, r=frewsxcv
Thread docs

r? @frewscvx
2016-12-19 16:59:41 +09:00
Seo Sanghyeon 813af34c92 Rollup merge of #38422 - zackmdavis:enjoy_tidy_path_error_macro_nicety, r=bluss
tidy features: use 2-parameter form of internal try macro for open err

This tiny patch merely applies @bluss's suggestion for how to get a more
informative error message when the feature check can't open a file, a
matter that had briefly annoyed the present author, leading to the
filing of #38417.

Resolves #38417.
2016-12-19 16:59:40 +09:00
Seo Sanghyeon 4b5cffc04b Rollup merge of #38421 - apasel422:issue-36934, r=alexcrichton
Replace invalid use of `&mut` with `UnsafeCell` in `std::sync::mpsc`

Closes #36934

r? @alexcrichton
2016-12-19 16:59:38 +09:00
Seo Sanghyeon d38beccdc4 Rollup merge of #38413 - rillian:armv7-neon, r=alexcrichton
rustc: Disable NEON on armv7 android.

We thought Google's ABI for arvm7 required neon, but it is
currently optional, perhaps because there is a significant
population of Tegra 2 devices still in use.

This turns off neon code generation outside #[target-feature]
blocks just like we do on armv7-unknown-linux-gnu, but unlike
most other armv7 targets. LLVM defaults to +neon for this target,
so an explicit disable is necessary.

See https://developer.android.com/ndk/guides/abis.html#v7a
for instruction set extension requirements.

Closes #38402.
2016-12-19 16:59:37 +09:00
Seo Sanghyeon 0c4e1db935 Rollup merge of #38397 - frewsxcv:platform-specific-process-exit, r=alexcrichton
Document platform-specific differences for `std::process::exit`.

Fixes https://github.com/rust-lang/rust/issues/35046.
2016-12-19 16:59:36 +09:00
Seo Sanghyeon 86cf9222e9 Rollup merge of #38334 - frewsxcv:BuildHasherDefault, r=GuillaumeGomez
Rewrite, improve documentation for `core:#️⃣:BuildHasherDefault`.

Fixes https://github.com/rust-lang/rust/issues/31242.
2016-12-19 16:59:35 +09:00
bors e70415bd71 Auto merge of #38411 - japaric:gh38406, r=alexcrichton
llvm: backport r280651

fixes #38406

r? @alexcrichton

(I'm secretly hoping this will error in the same way as #38314. That would sort of confirm that the problem is OOM and not enabling the SPARC backend)
2016-12-19 07:52:42 +00:00
bors cc662efca1 Auto merge of #38194 - sgrif:sg-no-span-mangling, r=nrc
Don't perform span mangling when building field/tup access nodes

There are no guarantees that the two spans used to create the new one
come from the same place or are even valid.

Fixes #36081.
2016-12-19 04:39:18 +00:00
Clar Charr 5049ad22ec From<[u16; 8]> for Ipv6Addr. 2016-12-18 23:09:48 -05:00
bors 0102127963 Auto merge of #38140 - jseyfried:proc_macro_visibility, r=nrc
Require `#[proc_macro_derive]` functions to be `pub`

r? @nrc
2016-12-19 01:23:32 +00:00
Jeffrey Seyfried dcae8bfb40 Give extern crates' root modules a better name. 2016-12-18 23:26:32 +00:00
Jeffrey Seyfried 745ddf2aa7 Refactor out `mark.as_placeholder_id()`. 2016-12-18 23:26:31 +00:00
Jeffrey Seyfried 6f040b48ef Avoid including attributes in bang macro invocations. 2016-12-18 23:26:31 +00:00
Jeffrey Seyfried 421c5d11c1 Remove scope placeholders, remove method `add_macro` of `ext::base::Resolver`. 2016-12-18 23:26:30 +00:00
Jeffrey Seyfried e80d1a8faf Remove `MacroDef`'s fields `imported_from` and `allow_internal_unstable`,
remove `export` argument of `resolver.add_macro()`.
2016-12-18 23:26:29 +00:00
Jeffrey Seyfried 4d638fd113 Canonicalize lifetime names. 2016-12-18 23:26:29 +00:00
Jeffrey Seyfried 532b013b28 Rename `ModuleS` -> `ModuleData`. 2016-12-18 23:26:27 +00:00
Jeffrey Seyfried aa19274b72 De-genericize `try_define`. 2016-12-18 23:26:26 +00:00
Jeffrey Seyfried 59de7f8f04 Add `ident.unhygienize()` and use `Ident` more instead of `Name` in `resolve`. 2016-12-18 23:26:22 +00:00
Jeffrey Seyfried 83ab9f7fac Remove some unused functions and fix formatting. 2016-12-18 23:25:30 +00:00
Jeffrey Seyfried b35c306b65 Fix the path resolutions of glob imports. 2016-12-18 23:23:23 +00:00
Corey Farwell 86fc63e62d Implement `fmt::Debug` for all structures in libstd.
Part of https://github.com/rust-lang/rust/issues/31869.

Also turn on the `missing_debug_implementations` lint at the crate
level.
2016-12-18 14:55:14 -08:00
bors 71c06a56a1 Auto merge of #38051 - sanxiyn:unused-type-alias-3, r=eddyb
Warn unused type aliases, reimplemented

Reimplementation of #37631. Fix #37455.
2016-12-18 22:06:34 +00:00
Simonas Kazlauskas b3b2f1b0d6 Use exec for the wrapper on UNIXes
This not only avoids the small – and unnecessary – constant overhead for each compiler invocation,
but also helps somewhat by only having “correct” rustc processes to look for in `/proc/`.

This also makes the wrapper behave effectively as a regular exec wrapper its intended to be.
2016-12-18 23:56:50 +02:00