Commit Graph

87187 Commits

Author SHA1 Message Date
John Kåre Alsaker
813b484d1e Fix printing of spans with no TyCtxt 2018-12-06 23:18:06 +01:00
John Kåre Alsaker
93294ea456 Fix 2018-12-06 23:18:06 +01:00
John Kåre Alsaker
4fac7396a2 Fix a race condition 2018-12-06 23:18:06 +01:00
John Kåre Alsaker
ecd5efa641 Show usages of query cycles and correctly shift queries in a cycle 2018-12-06 23:18:06 +01:00
Chris Barrick
b6d3668c42 Fix a stutter in the docs for slice::exact_chunks 2018-12-06 16:53:24 -05:00
ljedrz
adaeb10b5b codegen_utils, driver: fix clippy errors 2018-12-06 21:14:23 +01:00
bors
118e052d84 Auto merge of #56565 - matthiaskrgr:clippy, r=oli-obk
submodules: update clippy from 29bf75cd to 1df5766c

Fixes clippy toolstate.

Changes:
````
Remove -preview suffix from README
rustup clippy build with latest rustc (breakage due to 08f8faedd0 )
Forgot to remove some debugging code ...
Improved code noted by clippy.
Fix bug in `implicit_return`. Bug was already covered by test, but test was not checked for.
fix #3482 and add ui test for it
Don't change current working directory of cargo tests
Use cargo's "PROFILE" envvar and set CLIPPY_DOGFOOD
Use dogfood_runner for deterministic test ordering
Remove unnecessary documentation
Fix dogfood tests.
Added additional reasoning to `Why is this bad?`. Added comment to explain usage of MIR.
Renamed to `implicit_return`. Covered all other kinds besides `ExprKind::Lit`. Added check for replacing `break` with `return`.
Appeasing the Test Gods. Seems I'm not smart enough to run the tests locally before committing.
Renamed `forced_return` to `missing_returns`. Better clarification in the docs. Ran `update_lints`.
Added `FORCED_RETURN` lint.
````
r? @oli-obk
2018-12-06 19:51:38 +00:00
bors
cd48ce1e9a Auto merge of #56282 - qnighy:additional-sizedness-fix, r=nikomatsakis
Fix #56237: normalize type before deferred sizedness checking.

This seems to fix #56237, which was introduced by #56045. I don't thoroughly understand how this works, but the problem seemed to be a lack of normalization.

r? @cramertj
2018-12-06 17:31:15 +00:00
Matthias Krüger
078984d892 submodules: update clippy from 29bf75cd to 1df5766c
Fixes clippy toolstate.

Changes:
````
Remove -preview suffix from README
rustup clippy build with latest rustc (breakage due to 08f8faedd0 )
Forgot to remove some debugging code ...
Improved code noted by clippy.
Fix bug in `implicit_return`. Bug was already covered by test, but test was not checked for.
fix #3482 and add ui test for it
Don't change current working directory of cargo tests
Use cargo's "PROFILE" envvar and set CLIPPY_DOGFOOD
Use dogfood_runner for deterministic test ordering
Remove unnecessary documentation
Fix dogfood tests.
Added additional reasoning to `Why is this bad?`. Added comment to explain usage of MIR.
Renamed to `implicit_return`. Covered all other kinds besides `ExprKind::Lit`. Added check for replacing `break` with `return`.
Appeasing the Test Gods. Seems I'm not smart enough to run the tests locally before committing.
Renamed `forced_return` to `missing_returns`. Better clarification in the docs. Ran `update_lints`.
Added `FORCED_RETURN` lint.
````
2018-12-06 17:38:01 +01:00
John Kåre Alsaker
a70babed03 Use a function to access the Hir map to be able to turn it into a query later 2018-12-06 17:24:36 +01:00
bors
4bb5d35659 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.
2018-12-06 15:08:11 +00:00
Jethro Beekman
c559216ad0 Change sys::Thread::new to take the thread entry as Box<dyn FnBox() + 'static>̣ 2018-12-06 20:37:15 +05:30
Jethro Beekman
6c03640646 Update compiler_builtins and remove wasm f32<->f64 math conversions 2018-12-06 20:37:15 +05:30
Jethro Beekman
22c4368993 Refactor net::each_addr/lookup_host to forward error from resolve 2018-12-06 20:37:15 +05:30
Jethro Beekman
030b1ed7f7 Refactor stderr_prints_nothing into a more modular function 2018-12-06 20:37:15 +05:30
John Kåre Alsaker
7df4b812f0 Fix bug in from_key_hashed_nocheck 2018-12-06 14:32:00 +01:00
bors
367e783e6f Auto merge of #56557 - pietroalbini:rollup, r=pietroalbini
Rollup of 11 pull requests

Successful merges:

 - #56315 (Rustdoc inline macro reexport)
 - #56332 ([rustdoc] Specific crate search)
 - #56362 (Stabilise exhaustive integer patterns)
 - #56426 (libsyntax_pos: A few tweaks)
 - #56441 (rustbuild: Fix issues with compiler docs)
 - #56446 (pass the parameter environment to `traits::find_associated_item`)
 - #56500 (cleanup: remove static lifetimes from consts)
 - #56525 (Avoid extra copy and syscall in std::env::current_exe)
 - #56528 (Remove unused dependency (rustc_lint -> rustc_mir))
 - #56548 (Optimized string FromIterator + Extend impls)
 - #56553 (Don't print the profiling summary to stdout when -Zprofile-json is set)

Failed merges:

r? @ghost
2018-12-06 12:41:30 +00:00
bors
128a1fa4e1 Auto merge of #55635 - oli-obk:min_const_unsafe_fn, r=nikomatsakis
Allow calling `const unsafe fn` in `const fn` behind a feature gate

cc #55607

r? @Centril
2018-12-06 10:18:17 +00:00
Pietro Albini
cd1ee5edbd
Rollup merge of #56553 - wesleywiser:silence_profiler_output, r=Mark-Simulacrum
Don't print the profiling summary to stdout when -Zprofile-json is set

cc rust-lang-nursery/rustc-perf#299
2018-12-06 07:49:02 +01:00
Pietro Albini
e9e92d53ad
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`.
2018-12-06 07:49:01 +01:00
Pietro Albini
9e7ff56750
Rollup merge of #56528 - sinkuu:unused_dep, r=Mark-Simulacrum
Remove unused dependency (rustc_lint -> rustc_mir)
2018-12-06 07:49:00 +01:00
Pietro Albini
bd8dd11d4d
Rollup merge of #56525 - udoprog:linux-current-exe, r=alexcrichton
Avoid extra copy and syscall in std::env::current_exe
2018-12-06 07:48:58 +01:00
Pietro Albini
e941e1a624
Rollup merge of #56500 - ljedrz:cleanup_rest_of_const_lifetimes, r=zackmdavis
cleanup: remove static lifetimes from consts

A follow-up to https://github.com/rust-lang/rust/pull/56497.
2018-12-06 07:48:57 +01:00
Pietro Albini
50148a9566
Rollup merge of #56446 - arielb1:special-env-implications, r=nikomatsakis
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
2018-12-06 07:48:56 +01:00
Pietro Albini
0be8537e23
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
2018-12-06 07:48:55 +01:00
Pietro Albini
0aa72ad55d
Rollup merge of #56426 - petrochenkov:syntweak, r=nikomatsakis
libsyntax_pos: A few tweaks
2018-12-06 07:48:53 +01:00
Pietro Albini
e57ed0ddab
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.

Closes #50907.
2018-12-06 07:48:52 +01:00
Pietro Albini
a88feabac4
Rollup merge of #56332 - GuillaumeGomez:specifi-crate-search, r=QuietMisdreavus
[rustdoc] Specific crate search

Reopening of #54706.
Fixes #54616.

<img width="1440" alt="screenshot 2018-11-29 at 01 29 11" src="https://user-images.githubusercontent.com/3050060/49191372-979adf80-f376-11e8-963e-e4feb927c1da.png">

r? @QuietMisdreavus
2018-12-06 07:48:50 +01:00
Pietro Albini
3073c7af5f
Rollup merge of #56315 - weiznich:rustdoc_inline_macro_reexport, r=QuietMisdreavus
Rustdoc inline macro reexport

Fixes #56173

I assume this needs to have tests? Any pointers where these need to be added?
2018-12-06 07:48:48 +01:00
bors
77a6a61f06 Auto merge of #56307 - RalfJung:stacked-borrows-2-phase, r=oli-obk
Stacked borrows: Support 2 phase borrows

Some infrastructure needed for Stacked Borrows to be able to handle 2-phase-borros.

r? @oli-obk
2018-12-06 06:30:17 +00:00
Mark Rousskov
84443a3a24 Send textual profile data to stderr, not stdout
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.
2018-12-05 21:48:25 -07:00
Wesley Wiser
3858aff9d3 Don't print the profiling summary to stdout when -Zprofile-json is set
cc rust-lang-nursery/rustc-perf#299
2018-12-05 21:11:09 -05:00
Nathan West
811a2bfe53
Added explainatory comments 2018-12-05 17:46:03 -08:00
bors
1839c144bc 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.
2018-12-06 01:36:51 +00:00
Nathan West
823dd8ca33 Fixed mutability 2018-12-05 15:11:32 -08:00
bors
4988b096e6 Auto merge of #56549 - pietroalbini:rollup, r=pietroalbini
Rollup of 15 pull requests

Successful merges:

 - #51753 (Document `From` implementations)
 - #55563 (Improve no result found sentence in doc search)
 - #55987 (Add Weak.ptr_eq)
 - #56119 (Utilize `?` instead of `return None`.)
 - #56372 (Refer to the second borrow as the "second borrow" in E0501.rs)
 - #56388 (More MIR borrow check cleanup)
 - #56424 (Mention raw-ident syntax)
 - #56452 (Remove redundant clones)
 - #56456 (Handle existential types in dead code analysis)
 - #56466 (data_structures: remove tuple_slice)
 - #56476 (Fix invalid line number match)
 - #56497 (cleanup: remove static lifetimes from consts in libstd)
 - #56498 (Fix line numbers display)
 - #56523 (Added a bare-bones eslint config (removing jslint))
 - #56538 (Use inner iterator may_have_side_effect for Cloned)

Failed merges:

r? @ghost
2018-12-05 23:00:36 +00:00
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