Commit Graph

87140 Commits

Author SHA1 Message Date
Pietro Albini
f8ee5ab803
Rollup merge of #56538 - xfix:patch-13, r=bluss
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.
2018-12-05 23:54:39 +01:00
Pietro Albini
0fb90f372e
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).
2018-12-05 23:54:38 +01:00
Pietro Albini
39d4c0caa4
Rollup merge of #56498 - GuillaumeGomez:line-numbers, r=QuietMisdreavus
Fix line numbers display

Thanks to @talchas for finding the bug and suggesting the solution!

r? @QuietMisdreavus
2018-12-05 23:54:37 +01:00
Pietro Albini
bcf2fa190e
Rollup merge of #56497 - ljedrz:cleanup_libstd_const_lifetimes, r=kennytm
cleanup: remove static lifetimes from consts in libstd
2018-12-05 23:54:36 +01:00
Pietro Albini
d07d299cba
Rollup merge of #56476 - GuillaumeGomez:invalid-line-number-match, r=QuietMisdreavus
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
2018-12-05 23:54:34 +01:00
Pietro Albini
650b4ed5d1
Rollup merge of #56466 - ljedrz:delete_tuple_slice, r=nikomatsakis
data_structures: remove tuple_slice

It looks like we're not using it anywhere.
2018-12-05 23:54:33 +01:00
Pietro Albini
1276ffeba2
Rollup merge of #56456 - oli-obk:private_impl_trait, r=cramertj
Handle existential types in dead code analysis

fixes #55124

r? @cramertj
2018-12-05 23:54:32 +01:00
Pietro Albini
4ff4fc1bc9
Rollup merge of #56452 - sinkuu:redundant_clone, r=nikic
Remove redundant clones
2018-12-05 23:54:30 +01:00
Pietro Albini
21ba28f1c6
Rollup merge of #56424 - mark-i-m:explain-raw, r=Centril
Mention raw-ident syntax

According to https://github.com/rust-lang/rust/pull/56419#pullrequestreview-180542790

Blocked on #56419

r? @Centril
2018-12-05 23:54:29 +01:00
Pietro Albini
b6e2fc9aff
Rollup merge of #56388 - matthewjasper:more-lexical-mir-cleanup, r=nikomatsakis
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
2018-12-05 23:54:28 +01:00
Pietro Albini
b2a002dc4b
Rollup merge of #56372 - wildarch:issue-55314-second-borrow-ref, r=davidtwco
Refer to the second borrow as the "second borrow" in E0501.rs

Fixes #55314.

r? @davidtwco
2018-12-05 23:54:27 +01:00
Pietro Albini
64371f1cfe
Rollup merge of #56119 - frewsxcv:frewsxcv-option-carrier, r=TimNN
Utilize `?` instead of `return None`.

None
2018-12-05 23:54:25 +01:00
Pietro Albini
1594a4245b
Rollup merge of #55987 - Thomasdezeeuw:weak-ptr_eq, r=sfackler
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.
2018-12-05 23:54:24 +01:00
Pietro Albini
66ba6b3a66
Rollup merge of #55563 - GuillaumeGomez:doc-search-sentence, r=QuietMisdreavus
Improve no result found sentence in doc search

Fixes #55531.

Look:

<img width="1440" alt="screenshot 2018-11-01 at 02 21 56" src="https://user-images.githubusercontent.com/3050060/47827257-f6236c80-dd7c-11e8-9ea9-99c8cb4b2de5.png">

r? @QuietMisdreavus
2018-12-05 23:54:22 +01:00
Pietro Albini
159886863b
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.
2018-12-05 23:54:21 +01:00
Nathan West
180dcc3118 Optimized string FromIterator impls 2018-12-05 14:51:04 -08:00
varkor
ed64b1927b Fix precise_pointer_size_matching tests on all platforms 2018-12-05 23:21:56 +01:00
bors
14997d56a5 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"
```
2018-12-05 20:27:17 +00:00
bors
b866f7d258 Auto merge of #56535 - matthiaskrgr:clippy, r=oli-obk
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 :)
2018-12-05 17:54:17 +00:00
Konrad Borowski
a964307999 Add a test for cloned side effects 2018-12-05 17:53:34 +01:00
Konrad Borowski
3eddc743f2 Use inner iterator may_have_side_effect for Cloned
Previous implementation wasn't correct, as an inner iterator
could have had side effects.
2018-12-05 16:48:34 +01:00
Andy Russell
c359f98c7a
emit error when doc generation fails
Fixes #41813.
2018-12-05 10:10:31 -05:00
Matthias Krüger
dc0bbd0b31 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
````
2018-12-05 15:31:30 +01:00
bors
93ac09c3b5 Auto merge of #55466 - sinkuu:cleanup, r=petrochenkov
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.
2018-12-05 13:56:07 +00:00
bors
21cb46a6e9 Auto merge of #55922 - oli-obk:slice_pat_ice, r=zackmdavis
Fix ICE in `const` slice patterns

fixes #55911

based on https://github.com/rust-lang/rust/pull/55915

New commits start at eabc1551e0d0953f1951020afb5919ab4c129cf5
2018-12-05 07:16:17 +00:00
Shotaro Yamada
6cfbb5b9a1 Remove unused dependency (rustc_lint -> rustc_mir) 2018-12-05 14:06:32 +09:00
Shotaro Yamada
f423ff7be8 Fix pretty test 2018-12-05 12:15:28 +09:00
bors
d8046ed51a Auto merge of #56519 - steveklabnik:edition-guide, r=pietroalbini
update edition guide

spiritual successor to https://github.com/rust-lang/rust/pull/56457

not to be backported, being in nightly is enough.

i'm testing this locally now but figure travis can test it in parallel
2018-12-05 02:24:35 +00:00
John-John Tedro
3512fb0467 Avoid extra copy and syscall in std::env::current_exe 2018-12-05 02:55:12 +01:00
Matthew Russo
f0f8aa9e05 adds DocTest filename variant, refactors doctest_offset out of source_map, fixes remaining test failures 2018-12-04 19:52:42 -05:00
John Heitmann
5d7cf59e94 Added trailing newline 2018-12-04 16:13:04 -08:00
John Heitmann
56ace3e870 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.

Upcoming changes will start fixing lints.
2018-12-04 15:46:15 -08:00
Matthew Russo
88130f1796 updates all Filename variants to take a fingerprint 2018-12-04 17:24:12 -05:00
Matthew Russo
6ee4d3cafc new_source_file no longer enters duplicate files, expand_include_bytes includes the source if it can convert bytes to string 2018-12-04 17:19:55 -05:00
Steve Klabnik
6b0ac4987a build the edition guide
and update it so that links are correct
2018-12-04 17:06:16 -05:00
bors
b3af09205b Auto merge of #56486 - matthewjasper:propagate-all-closure-bounds, r=pnkfelix
Propagate all closure requirements to the caller

Closes #56477

This should be backported to 1.32 if it doesn't make the cut.

r? @pnkfelix
cc @nikomatsakis
2018-12-04 20:56:11 +00:00
Corey Farwell
c025d61409 Replace usages of ..i + 1 ranges with ..=i. 2018-12-04 12:05:19 -08:00
Matthew Jasper
b2e6da7a7f Call methods on the right tcx
There are two `TyCtxt`s, one global, one local. Methods must be called
on the right one, as they differ by invariant lifetimes.
2018-12-04 19:52:47 +00:00
Corey Farwell
9012af6f19 Utilize ? instead of return None. 2018-12-04 08:57:34 -08:00
bors
906deae079 Auto merge of #56244 - oli-obk:loud_ui_errors, r=nikomatsakis
Report failing tests without `//~ ERROR` comments

r? @nikomatsakis
2018-12-04 16:26:18 +00:00
Nikita Popov
8128d0d1a9 Serialize modules into ThinBuffer after initial optimization
Instead of keeping all modules in memory until thin LTO and only
serializing them then, serialize the module immediately after
it finishes optimizing.
2018-12-04 16:24:20 +01:00
Andy Russell
a367cec6e3
emit error with span for empty asserts
Fixes #55547.
2018-12-04 10:22:48 -05:00
Nikita Popov
bc2db43b9e Remove unnecessary parts of run_fat_lto signature
Fat LTO merges into one module, so only return one module.
2018-12-04 16:10:24 +01:00
Nikita Popov
bdbee6311b Separate out methods for running thin and fat LTO 2018-12-04 16:10:24 +01:00
Nikita Popov
a17de6980a Separate codepaths for fat and thin LTO in write.rs
These are going to have different intermediate artifacts, so
create separate codepaths for them.
2018-12-04 16:10:24 +01:00
Nikita Popov
2c1883c1a6 Refactor LTO type determination
Instead of only determining whether some form of LTO is necessary,
determine whether thin, fat or no LTO is necessary. I've rewritten
the conditions in a way that I think is more obvious, i.e. specified
LTO type + additional preconditions.
2018-12-04 16:10:24 +01:00
Nikita Popov
9c657e82df Extract free_worker closure 2018-12-04 16:10:24 +01:00
Hugues de Valon
0f47c2a078 Add Armv8-M Mainline targets
This commit enables the Armv8-M Mainline architecture profile.
It adds two targets:
  - thumbv8m.main-none-eabi
  - thumbv8m.main-none-eabihf

The second one uses the Floating Point Unit for floating point
operations. It mainly targets the Cortex-M33 processor, which
can have the optional Floating Point Unit extension.
2018-12-04 13:30:59 +00:00
bors
431e0ab62f 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.
2018-12-04 11:47:07 +00:00
ljedrz
d0c64bb296 cleanup: remove static lifetimes from consts 2018-12-04 12:46:10 +01:00