bors [Thu, 6 Dec 2018 15:08:11 +0000 (15:08 +0000)]
Auto merge of #56392 - petrochenkov:regensym, r=oli-obk
Delay gensym creation for "underscore items" (`use foo as _`/`const _`) until name resolution
So they cannot be cloned by macros. See https://github.com/rust-lang/rust/pull/56303 for the discussion.
Mostly fix cross-crate use of underscore items by inverting the "gensyms are lost in metadata" bug as described in https://github.com/rust-lang/rust/pull/56303#issuecomment-442464695.
Fix unused import warnings for single-segment imports (first commit) and `use crate_name as _` imports (as specified in https://github.com/rust-lang/rust/pull/56303#issuecomment-442274118).
Prohibit accidentally implemented `static _: TYPE = EXPR;` (cc https://github.com/rust-lang/rust/pull/55983).
Add more tests for `use foo as _` imports.
Pietro Albini [Thu, 6 Dec 2018 06:49:01 +0000 (07:49 +0100)]
Rollup merge of #56548 - Lucretiel:string-extend-optimize, r=sfackler
Optimized string FromIterator + Extend impls
I noticed that there was a lost opportunity to reuse string buffers in `FromIterator<String>` and `FromIterator<Cow<str>>`; updated the implementations to use these. In practice this translates to at least one fewer allocation when using these APIs.
Additionally, rewrote `Extend` implementations to use `iter.for_each`, which (supposedly) helps the compiler optimize those loops (because iterator adapters are encouraged to provide optimized implementations of `fold` and `try_fold`.
Pietro Albini [Thu, 6 Dec 2018 06:48:55 +0000 (07:48 +0100)]
Rollup merge of #56441 - ollie27:rustbuild_compiler_docs, r=alexcrichton
rustbuild: Fix issues with compiler docs
* Create output directories for crates beforehand so rustdoc uses relative links (fixes #56107)
* Readd rustc_codegen_ssa (fixes #56196)
* Don't build out of tree dependencies for rustdoc like we don't for rustc
Pietro Albini [Thu, 6 Dec 2018 06:48:52 +0000 (07:48 +0100)]
Rollup merge of #56362 - varkor:stabilise-exhaustive-integer-patterns, r=nikomatsakis
Stabilise exhaustive integer patterns
This is dependent on the FCP for https://github.com/rust-lang/rfcs/pull/2591 being completed, but that should happen tomorrow, so there's little harm in opening this PR early.
bors [Thu, 6 Dec 2018 01:36:51 +0000 (01:36 +0000)]
Auto merge of #54517 - mcr431:53956-panic-on-include_bytes-of-own-file, r=michaelwoerister
53956 panic on include bytes of own file
fix #53956
When using `include_bytes!` on a source file in the project, compiler would panic on subsequent compilations because `expand_include_bytes` would overwrite files in the source_map with no source. This PR changes `expand_include_bytes` to check source_map and use the already existing src, if any.
Pietro Albini [Wed, 5 Dec 2018 22:54:38 +0000 (23:54 +0100)]
Rollup merge of #56523 - JohnHeitmann:es6, r=GuillaumeGomez
Added a bare-bones eslint config (removing jslint)
This change removes the small bit of jslint config, replacing it
with eslint. I've currently configured eslint to mostly only report
the more serious of lints, although there are still some style nits
turned on.
Eslint better supports modern js, and will be a good pre-TypeScript code
quality aid.
Install eslint with `npm install -g eslint`. Run with `eslint html/static/*.js`,
or let your IDE do it. This requires no build step.
Upcoming changes will start fixing identified bugs and other lints (mostly unused and var redef issues).
Pietro Albini [Wed, 5 Dec 2018 22:54:21 +0000 (23:54 +0100)]
Rollup merge of #51753 - gruberb:document-from-conversions-libstdpath, r=QuietMisdreavus
Document `From` implementations
This PR is solves part of https://github.com/rust-lang/rust/issues/51430. It's my first PR, so I might need some guidance from @skade (as already mentioned in the issue).
The purpose of the PR is to document the `impl From` inside `path.rs` and answering the questions:
- What does it convert?
- Does it allocate memory?
- How expensive are the allocations?
I gave it a first shot, though an experienced rust developer might want to look over it.
bors [Wed, 5 Dec 2018 20:27:17 +0000 (20:27 +0000)]
Auto merge of #55933 - euclio:doc-panic, r=QuietMisdreavus
emit error when doc generation fails
Fixes #41813.
The diagnostic looks something like this:
```
error: couldn't generate documentation: No space left on device (os error 28)
|
= note: failed to create or modify "/path/to/crate/target/doc/src/lazycell"
```
Changes:
````
Fix ty::TyKind usage
Fix TyKind::<kind> usage in codebase
Extract single_match_else UI test
cargo fmt
Adds inequality cases to bool comparison lint
Remove unsafe_vector_initialization lint
Fix wildcard_dependencies false positive
Fix rustfmt format
Disable incremental build for windows
Travis: Add rustc sysroot bin to PATH for windows build
Fix some nursery links
Enforce LF lineendings for everything
Mention triage procedure in contributing.md
Keep testing large_digit_groups as ui test
Keep testing unsafe_vector_initialization as ui test
Downgrade large_digit_groups to pedantic
Downgrade unsafe_vector_initialization to restriction
remove macro_at_most_once_rep feature attribute since it's stable
Add missing word
Update docs in regards to the merged RFC
Document how to run rustfmt in CONTRIBUTING.md
Don't run integration tests in forks
Fix some formatting issues
Run rustfmt on clippy_lints
Run rustfmt on build.rs
Run rustfmt on clippy_dev
Run rustfmt on rustc_tools_util
Run rustfmt on src
Run rustfmt on the tests
Let travis run cargo fmt --all -- --check
Error on line overflow
````
No need to increase priority, please just rollup :)
Changes:
````
Fix ty::TyKind usage
Fix TyKind::<kind> usage in codebase
Extract single_match_else UI test
cargo fmt
Adds inequality cases to bool comparison lint
Remove unsafe_vector_initialization lint
Fix wildcard_dependencies false positive
Fix rustfmt format
Disable incremental build for windows
Travis: Add rustc sysroot bin to PATH for windows build
Fix some nursery links
Enforce LF lineendings for everything
Mention triage procedure in contributing.md
Keep testing large_digit_groups as ui test
Keep testing unsafe_vector_initialization as ui test
Downgrade large_digit_groups to pedantic
Downgrade unsafe_vector_initialization to restriction
remove macro_at_most_once_rep feature attribute since it's stable
Add missing word
Update docs in regards to the merged RFC
Document how to run rustfmt in CONTRIBUTING.md
Don't run integration tests in forks
Fix some formatting issues
Run rustfmt on clippy_lints
Run rustfmt on build.rs
Run rustfmt on clippy_dev
Run rustfmt on rustc_tools_util
Run rustfmt on src
Run rustfmt on the tests
Let travis run cargo fmt --all -- --check
Error on line overflow
````
John Heitmann [Tue, 4 Dec 2018 21:59:27 +0000 (13:59 -0800)]
Added a bare-bones eslint config (removing jslint)
This change removes the small bit of jslint config, replacing it
with eslint. I've currently configured eslint to mostly only report
the more serious of lints, although there are still some style nits
turned on.
bors [Tue, 4 Dec 2018 11:47:07 +0000 (11:47 +0000)]
Auto merge of #55871 - ljedrz:llvm_back_allocations, r=nagisa
codegen_llvm_back: improve allocations
This commit was split out from https://github.com/rust-lang/rust/pull/54864. Last time it was causing an LLVM OOM, which was most probably caused by not collecting the globals.
- preallocate vectors of known length
- `extend` instead of `append` where the argument is consumable
- turn 2 `push` loops into `extend`s
- create a vector from a function producing one instead of using `extend_from_slice` on it
- consume `modules` when no longer needed
- ~~return an `impl Iterator` from `generate_lto_work`~~
- ~~don't `collect` `globals`, as they are iterated over and consumed right afterwards~~
While I'm hoping it won't cause an OOM anymore, I would still consider this a "high-risk" PR and not roll it up.
bors [Tue, 4 Dec 2018 09:21:21 +0000 (09:21 +0000)]
Auto merge of #56224 - ehuss:update-cargo, r=alexcrichton
Update cargo, rls
26 commits in b3d0b2e545b61d4cd08096911724b7d49d213f73..5e85ba14aaa20f8133863373404cb0af69eeef2c
2018-11-15 19:13:04 +0000 to 2018-12-02 14:37:25 +0000
- ConflictStoreTrie: Faster filtered search (rust-lang/cargo#6366)
- Remove `cmake` as a requirement (rust-lang/cargo#6368)
- progress: display "Downloading 1 crate" instead of "Downloading 1 crates" (rust-lang/cargo#6369)
- Use expect over unwrap, for panic-in-panic aborts (rust-lang/cargo#6364)
- Switch to pretty_env_logger, under --features pretty-env-logger (rust-lang/cargo#6362)
- use allow-dirty option in `cargo package` to skip vcs checks (rust-lang/cargo#6280)
- remove clones made redundant by Intern PackageId (rust-lang/cargo#6352)
- docs: correct profile usage of `cargo test --release` (rust-lang/cargo#6345)
- Improve doc for `cargo install` (rust-lang/cargo#6354)
- Intern PackageId (rust-lang/cargo#6332)
- Clean only release artifacts if --release option is set (rust-lang/cargo#6349)
- remove clones made redundant by Intern SourceId (rust-lang/cargo#6347)
- Intern SourceId (rust-lang/cargo#6342)
- Tweak Layout to allow for non json file targets with internal "." (rust-lang/cargo#6255)
- Correct Target Directory command-line option (rust-lang/cargo#6343)
- Persistent data structures by im-rs (rust-lang/cargo#6336)
- Move command prelude into main library (rust-lang/cargo#6335)
- Distinguish custom build invocations (rust-lang/cargo#6331)
- Allow crate_type=bin examples to run (rust-lang/cargo#6330)
- Make verify-project honour unstable features (rust-lang/cargo#6326)
- Make autodiscovery disable inferred targets (rust-lang/cargo#6329)
- Add `c` alias for `check` (rust-lang/cargo#6218)
- Allow user aliases to override built-in aliases (rust-lang/cargo#6259)
- Fix renaming directory project using build scripts with cross-compiling. (rust-lang/cargo#6328)
- Fix add_plugin_deps-related tests. (rust-lang/cargo#6327)
- Add a glossary. (rust-lang/cargo#6321)