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`.
pass the parameter environment to `traits::find_associated_item`
dropping the param-env on the floor is obviously the wrong thing to do.
The ICE was probably exposed by #54490 adding the problem-exposing use of
`traits::find_associated_item`.
Fixes#55380.
r? @nikomatsakis
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
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.
Closes#50907.
This makes it possible to run with RUSTFLAGS="-Zself-profile" without
having to redirect compiler output; otherwise Cargo will error out due
to non-empty compiler stdout.
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.
Use inner iterator may_have_side_effect for Cloned
Previous implementation wasn't correct, as an inner iterator could have had side effects. Noticed by @bluss in #56534.
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).
Fix invalid line number match
If a code line is longer than the width, it then gets to the next line making the line number not matching it anymore.
r? @QuietMisdreavus
More MIR borrow check cleanup
* Fix some rustc doc links
* Remove the `region_map` field from `BorrowSet`
* Use `visit_local` to find 2PB activations
r? @nikomatsakis
Add Weak.ptr_eq
I hope the doc tests alone are good enough.
We also might want to discuss the dangling pointer case (from `Weak::new()`).
Updates #55981.
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.
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"
```
submodules: update clippy from b2601beb to 29bf75cd
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
````
syntax: Use iterator and pattern APIs instead of `char_at`
Iterating over chars with the `char_at(str, i)` `i += ch.len_utf8()` loop seems unidiomatic.