Mark Simulacrum [Fri, 19 May 2017 20:16:25 +0000 (14:16 -0600)]
Rollup merge of #42096 - ollie27:rustdoc_js_impls, r=GuillaumeGomez
rustdoc: Fix implementors list javascript
* Use a different loop variable, `i` was already taken. This caused
missing items in the implementors list.
* Use `.getAttribute('href')` rather than `.href` to get the relative
URL which is what it needs to actually fix the links.
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report:
https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value:
"foo�bar"', /checkout/src/libcore/result.rs:859 note: Run with
`RUST_BACKTRACE=1` for a backtrace.
```
Now it gives a clean error:
```
$ rustc $'foo\x80bar'
error: Argument 1 is not valid Unicode: "foo�bar"
```
Maybe fixes #15890, although we still can't *compile* arbitrary file names.
Mark Simulacrum [Fri, 19 May 2017 20:16:23 +0000 (14:16 -0600)]
Rollup merge of #42082 - michaelwoerister:wider_def_path_hashes, r=eddyb
incr. comp.: Use more bits for DefPath hashes
Use 128 instead of 64 bits for DefPath hashes, like we do for everything else. Collision probability is unnecessarily high with 64 bits.
Also change the representation of `ich::Fingerprint` from `Fingerprint([u8; 16])` to `Fingerprint(u64, u64)` which is better for hashers like `FxHasher`.
Mark Simulacrum [Fri, 19 May 2017 20:16:19 +0000 (14:16 -0600)]
Rollup merge of #42067 - Keruspe:master, r=alexcrichton
rustbuild: install improvements
Install rust-analysis and rust-src to get in par with what we can get from rustup.
Allow bypassing the vendoring of dependencies. When we only build to install and not to redistribute dist tarballs, that part is not necessary, so avoid trying to install cargo-vendor.
Mark Simulacrum [Fri, 19 May 2017 20:16:14 +0000 (14:16 -0600)]
Rollup merge of #41971 - japaric:pre-link-args, r=alexcrichton
add -Z pre-link-arg{,s} to rustc
This PR adds two unstable flags to `rustc`: `-Z pre-link-arg` and `-Z
pre-link-args`. These are the counterpart of the existing `-C link-arg{,s}`
flags and can be used to pass extra arguments at the *beginning* of the linker
invocation, before the Rust object files are passed.
I have [started] a discussion on the rust-embedded RFCs repo about settling on a
convention for passing extra arguments to the linker and there are two options
on discussion: `.cargo/config`'s `target.$T.rustflags` and custom target
specification files (`{pre,,post}-link-args` fields). However, to compare these
two options on equal footing this `-Z pre-link-arg` feature is required.
Mark Simulacrum [Fri, 19 May 2017 20:16:14 +0000 (14:16 -0600)]
Rollup merge of #41958 - malbarbo:docker-share, r=alexcrichton
ci: allows files to be shared by docker images
Change `src/ci/docker/run.sh` to allow files to be shared when building docker containers. For while, only android related shell scripts are shared. Others containers can be updated at any time.
sccache is installed last, as it is frequently updated this avoids the need to rebuilt the whole container.
Mark Simulacrum [Fri, 19 May 2017 20:16:12 +0000 (14:16 -0600)]
Rollup merge of #41870 - excaliburHisSheath:iss29367-windows-docs, r=frewsxcv
Improve docs in os::windows::ffi and os::windows::fs
Part of #29367
This PR makes changes to the documentation in `os::windows::ffi` and `os::windows::fs` with the goal of fleshing them out and bringing them in line with Rust's quality standards.
David LeGare [Fri, 19 May 2017 02:10:15 +0000 (21:10 -0500)]
Normalize docs in windows::ffi and windows::fs
- Remove `()` parens when referencing functions in docs.
- Change some examples to be no_run instead of ignore.
- Normalize style in examples for `OpenOptionsExt`.
- Fix typo in windows mod docs.
Oliver Middleton [Fri, 19 May 2017 01:59:04 +0000 (02:59 +0100)]
rustdoc: Fix implementors list javascript
* Use a different loop variable, `i` was already taken. This caused
missing items in the implementors list.
* Use `.getAttribute('href')` rather than `.href` to get the relative
URL which is what it needs to actually fix the links.
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report:
https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value:
"foo�bar"', /checkout/src/libcore/result.rs:859 note: Run with
`RUST_BACKTRACE=1` for a backtrace.
```
Now it gives a clean error:
```
$ rustc $'foo\x80bar'
error: Argument 1 is not valid Unicode: "foo�bar"
```
Maybe fixes #15890, although we still can't *compile* arbitrary file names.
bors [Thu, 18 May 2017 09:32:28 +0000 (09:32 +0000)]
Auto merge of #42055 - michaelwoerister:reenable-incremental-cc, r=nikomatsakis
Enable cross-crate incremental compilation by default.
Now that direct metadata hashing has been implemented for a while and we haven't seen any problems with it over at [rust-icci](https://travis-ci.org/rust-icci/), let's re-enable cross crate support for incremental compilation again.
Nick Cameron [Wed, 17 May 2017 22:37:24 +0000 (10:37 +1200)]
Add an option to the parser to avoid parsing out of line modules
This is useful if parsing from stdin or a String and don't want to try and read in a module from another file. Instead we just leave a stub in the AST.
bors [Wed, 17 May 2017 21:44:08 +0000 (21:44 +0000)]
Auto merge of #41911 - michaelwoerister:querify_trait_def, r=nikomatsakis
Remove interior mutability from TraitDef by turning fields into queries
This PR gets rid of anything `std::cell` in `TraitDef` by
- moving the global list of trait impls from `TraitDef` into a query,
- moving the list of trait impls relevent for some self-type from `TraitDef` into a query
- moving the specialization graph of trait impls into a query, and
- moving `TraitDef::object_safety` into a query.
I really like how querifying things not only helps with incremental compilation and on-demand, but also just plain makes the code cleaner `:)`
There are also some smaller fixes in the PR. Commits can be reviewed separately.
bors [Wed, 17 May 2017 08:14:55 +0000 (08:14 +0000)]
Auto merge of #41961 - kennytm:fix-35829, r=petrochenkov
Fix #35829 (`quote!()` does not handle `br#"…"#`)
Fix issue #35829 (syntax extension's `quote_expr!()` does not handle `b"…"` and proc_macro's `quote!()` does not handle `r#"…"#`)
* Handles `b"…"`, `br#"…"#` and `...` for `quote_expr!()`.
* Refactored the match statement to allow it to complain loudly on any unhandled token.
* Similarly, proc_macro's `quote!()` did not handle `br#"…"#` or `r#"…"#`, so this PR fixes it too.
kennytm [Mon, 15 May 2017 19:16:18 +0000 (03:16 +0800)]
Refactor: Move the mutable parts out of LintStore. Fix #42007.
* #42007 happens because the Session LintStore is emptied when linting.
* The Session LintStore is emptied because the checker (Early/LateContext)
wants ownership.
* The checker wants ownership because it wants to mutate the pass objects
and lint levels.
The ownership of the whole store is not essential, only the lint levels and
pass objects need to be owned. Therefore, these parts are extracted out of
the LintStore into a separate structure `LintSession`. The "check crates"
methods can operate on `&mut LintSession` instead of `&mut LintStore`.
This is a minor BREAKING CHANGE for lint writers since the `LintContext`
trait is changed: the `mut_lints` and `level_stack` methods are removed.
But no one outside of `librustc/lint/context.rs` is using these functions,
so it should be safe.
bors [Wed, 17 May 2017 04:21:06 +0000 (04:21 +0000)]
Auto merge of #41476 - abonander:book_proc_macro, r=nrc
Document the `proc_macro` feature in the Unstable Book
Discusses the `proc_macro` feature flag and the features it enables:
* Implicit enable of `extern_use_macros` feature and how to import proc macros
* Error handling in proc macros (using panic messages)
* Function-like proc macros using `#[proc_macro]` and a usage example for creating and invoking
* Attribute-like proc macros using `#[proc_macro_attribute]` and a usage example for creating and invoking
Mark Simulacrum [Tue, 16 May 2017 23:31:51 +0000 (17:31 -0600)]
Rollup merge of #42039 - alexcrichton:update-cargo, r=aturon
Update cargo submodule
This pulls in a fix for #41797 to the master branch, I'll send a separate PR for
the beta branch. Note that the Cargo PR in question to pull in is https://github.com/rust-lang/cargo/pull/4046
Mark Simulacrum [Tue, 16 May 2017 23:31:50 +0000 (17:31 -0600)]
Rollup merge of #42017 - nikomatsakis:issue-41677, r=arielb1
avoid cycles in mir-dump, take 2
This fixes #41697, for real this time, but I'm not sure how best to add a regression test. I was considering maybe adding some flag so that the MIR dumping doesn't actually get written to files (e.g., overloading the directory flag so you can specify nil or something).
Mark Simulacrum [Tue, 16 May 2017 23:31:49 +0000 (17:31 -0600)]
Rollup merge of #41937 - nikomatsakis:issue-41936-variance-coerce-unsized-cycle, r=eddyb
use equality in the coerce-unsized check
This seems both to be a safe, conservative choice, and it sidesteps the cycle in #41849. Note that, before I converted variance into proper queries, we were using a hybrid of subtyping and equality, due to the presence of a flag that forced invariance if variance had not yet been computed. (Also, Coerce Unsized is unstable.)
bors [Tue, 16 May 2017 23:27:36 +0000 (23:27 +0000)]
Auto merge of #41907 - est31:macro_unused, r=jseyfried
Add lint for unused macros
Addresses parts of #34938, to add a lint for unused macros.
We now output warnings by default when we encounter a macro that we didn't use for expansion.
Issues to be resolved before this PR is ready for merge:
- [x] fix the NodeId issue described above
- [x] remove all unused macros from rustc and the libraries or set `#[allow(unused_macros)]` next to them if they should be kept for some reason. This is needed for successful boostrap and bors to accept the PR. -> #41934
- [x] ~~implement the full extent of #34938, that means the macro match arm checking as well.~~ *let's not do this for now*
This is a resurrection of #40776, combining their Windows setup with an
additional setup on Unix to set the program group's niceness to +10
(low-but-not-lowest priority) when the `low_priority` option is on.
bors [Tue, 16 May 2017 17:18:23 +0000 (17:18 +0000)]
Auto merge of #41853 - Keruspe:install, r=alexcrichton
rustbuild: add support for --bindir and --sysconfdir
This depends on https://github.com/rust-lang/rust-installer/pull/59 and we'll need to udpate the rust-installer submodule once it gets merged for it to work