Commit Graph

88439 Commits

Author SHA1 Message Date
Philipp Hansch
a89cecef01
docs: Fix some 'second-edition' links 2019-01-09 07:19:29 +01:00
Nicholas Nethercote
46fa818d34 Change String to &'static str in ParseResult::Failure.
This avoids 770,000 allocations when compiling the `html5ever`
benchmark, reducing instruction counts by up to 2%.
2019-01-09 15:16:19 +11:00
scottmcm
986e49da04
Merge pull request #1 from Centril/redo-vec-set_len-docs-adjust
Explain safety for `vec.set_len(0)`
2019-01-08 19:41:32 -08:00
Blitzerr
69e491815d addressing Niko's comments 2019-01-08 19:19:34 -08:00
Mazdak Farrokhzad
5052197e44 explain safety for vec.set_len(0) 2019-01-09 04:17:24 +01:00
Blitzerr
15d8e8fb2b [Cleanup] This is the first in the series of removals of with_freevars usage.
Currently, there are many places in rustc, where we use
with_freevars to iterate over freevars of a closure. The
problem with this is the argument to with_freevars is a
NodeId and this will get in the way of our eventual goal
of solving for issue (#53488), sub-issue (#56905)
2019-01-08 17:57:22 -08:00
Blitzerr
7853b780fc Some more refactoring.
Change the key of UpvarListMap from DefId to ast::NodeId
2019-01-08 17:57:22 -08:00
Blitzerr
410b52958d Creating the vector using with_capacity to avoid re-allocation later on (#56905) 2019-01-08 17:57:22 -08:00
Blitzerr
47db51eece Issue 56905
Adding a map to TypeckTables to get the list of all the Upvars
given a closureID. This is help us get rid of the recurring
pattern in the codebase of iterating over the free vars
using with_freevars.
2019-01-08 17:57:22 -08:00
varkor
ac4a4547ba Consolidate equality constraints error message 2019-01-08 23:53:43 +00:00
varkor
d1b65fb691 Add issue reference to E0202 message 2019-01-08 23:53:19 +00:00
Czipperz
564a24c772 Change std::error::Error trait documentation to talk about source instead of cause 2019-01-08 17:45:54 -05:00
bors
167ceff01e Auto merge of #56407 - GuillaumeGomez:missing-docs-reexported-macros, r=varkor
check missing docs for reexported macros as well

Fixes #56334.
2019-01-08 22:16:13 +00:00
Shotaro Yamada
12ae3651f8 Misc cleanups 2019-01-09 06:31:09 +09:00
Josh Stone
d9ddc39052 lldb_batchmode.py: try import _thread for Python 3 2019-01-08 13:19:50 -08:00
bors
d22fa2d87d Auto merge of #56638 - matthewjasper:remove-ref-region, r=nikomatsakis
Remove some `Region`s from HAIR

Use `ReErased` for any regions that need to be created in RValue::Ref
in MIR generation. We will change them to all to `ReVar` before borrow
checking anyway.

r? @nikomatsakis
2019-01-08 19:33:20 +00:00
Guillaume Gomez
0b272e7400 Update stdsimd submodule 2019-01-08 20:24:15 +01:00
Andy Russell
1b28f5aa66
improve non_camel_case_types diagnostics
Use a structured suggestion and tighten the span to just the identifier.
2019-01-08 13:24:38 -05:00
Andy Russell
e379970056
improve non_upper_case_globals diagnostics
Use a structured suggestion and tighten the span to just the identifier.
2019-01-08 13:24:38 -05:00
Andy Russell
7c0d145ec1
improve non_snake_case diagnostics
Use a structured suggestion and tighten the span to just the identifier.
2019-01-08 13:24:38 -05:00
John Kåre Alsaker
f21c08439a Move diagnostics out from QueryJob and optimize for the case with no diagnostics 2019-01-08 18:50:43 +01:00
bors
2cb7cdcb36 Auto merge of #57429 - alexcrichton:fix-dist, r=Mark-Simulacrum
Build LLVM with -static-libstdc++ on dist builds

This commit is intended on fixing a regression from #57286 where the
distributed LLVM shared library unfortunately depends on a dynamic copy
of libstdc++, meaning we're no longer as binary compatible as we
thought! This tweaks the build of LLVM as out distribution is slightly
different now, and is hoped to fix the issue.

Closes #57426
2019-01-08 16:47:27 +00:00
Vardhan Thigle
4166a4e5d0 Supporting backtrace for x86_64-fortanix-unknown-sgx. 2019-01-08 22:10:55 +05:30
Oliver Scherer
2ab78e195a More feature whitelisting of winapi 2019-01-08 15:21:07 +01:00
Oliver Scherer
edaa1882bb Adjust cargo workspace hack to miri/cargo interactions 2019-01-08 15:21:06 +01:00
Oliver Scherer
f8033a2923 fixup 2019-01-08 15:21:06 +01:00
Oliver Scherer
83530120ea Prepare everything for distributing miri via rustup 2019-01-08 15:21:06 +01:00
Oliver Scherer
67ede4cb7f Ignore some IDE-local files 2019-01-08 15:21:06 +01:00
bors
b8c8f0bdf6 Auto merge of #57114 - Zoxc:query-perf11, r=michaelwoerister
Clean up and optimize OpenTask / read_index

r? @michaelwoerister
2019-01-08 14:11:19 +00:00
bors
2f19f8cec9 Auto merge of #56988 - alexcrichton:monotonic-instant, r=sfackler
std: Force `Instant::now()` to be monotonic

This commit is an attempt to force `Instant::now` to be monotonic
through any means possible. We tried relying on OS/hardware/clock
implementations, but those seem buggy enough that we can't rely on them
in practice. This commit implements the same hammer Firefox recently
implemented (noted in #56612) which is to just keep whatever the lastest
`Instant::now()` return value was in memory, returning that instead of
the OS looks like it's moving backwards.

Closes #48514
Closes #49281
cc #51648
cc #56560
Closes #56612
Closes #56940
2019-01-08 11:30:19 +00:00
Oliver Scherer
cea282bcfd Make mk_eval_cx private to const eval 2019-01-08 10:54:40 +01:00
Oliver Scherer
14e662d8c5 Manually push a stack frame where no valid frame is needed 2019-01-08 10:54:24 +01:00
bors
7ad470c0a6 Auto merge of #57332 - Dylan-DPC:feature/stabilise-cfg-attr, r=Centril
stabilize cfg_attr_multi

Stabilizes cfg_attr_multi feature

Related to #54881

Will add the lint in a seperate PR

r? @Centril
2019-01-08 07:49:13 +00:00
Nicholas Nethercote
8780ebff1f Remove CrateNum::Invalid.
It's unused.
2019-01-08 16:13:22 +11:00
Dylan MacKenzie
68b8b438c3 Add link destination for read-ownership 2019-01-07 21:03:41 -08:00
Nicholas Nethercote
e80a93040f Make TokenStream less recursive.
`TokenStream` is currently recursive in *two* ways:

- the `TokenTree` variant contains a `ThinTokenStream`, which can
  contain a `TokenStream`;

- the `TokenStream` variant contains a `Vec<TokenStream>`.

The latter is not necessary and causes significant complexity. This
commit replaces it with the simpler `Vec<(TokenTree, IsJoint)>`.

This reduces complexity significantly. In particular, `StreamCursor` is
eliminated, and `Cursor` becomes much simpler, consisting now of just a
`TokenStream` and an index.

The commit also removes the `Extend` impl for `TokenStream`, because it
is only used in tests. (The commit also removes those tests.)

Overall, the commit reduces the number of lines of code by almost 200.
2019-01-08 15:08:46 +11:00
Alex Crichton
d58555323f Build LLVM with -static-libstdc++ on dist builds
This commit is intended on fixing a regression from #57286 where the
distributed LLVM shared library unfortunately depends on a dynamic copy
of libstdc++, meaning we're no longer as binary compatible as we
thought! This tweaks the build of LLVM as out distribution is slightly
different now, and is hoped to fix the issue.

Closes #57426
2019-01-07 19:48:16 -08:00
bors
9d54812829 Auto merge of #57095 - Zoxc:prof-fix, r=michaelwoerister
Fix and optimize query profiling

r? @michaelwoerister

cc @wesleywiser
2019-01-08 02:00:12 +00:00
Igor Matuszewski
eed163e110 save-analysis: use a fallback when access levels couldn't be computed 2019-01-08 01:02:13 +01:00
Taylor Cramer
68e98a2a85 Reborrow Pin<P> using &mut in Pin::set
This makes it possible to call `.set` multiple times without
using `.as_mut()` first to reborrow the pointer.
2019-01-07 11:45:34 -08:00
bors
8e2063d020 Auto merge of #57303 - matthiaskrgr:clippy_submodule_upd, r=oli-obk
submodules: update clippy and rls

Fixes clippy toolstate

Changes:
````
Update to latest compiletest-rs release
add testcase for #3462
deps: bump rustc_tools_util version from 0.1.0 to 0.1.1 just in case...
rustc_tool_utils: fix failure to create proper non-repo version string when used in crates on crates.io, bump version
UI test cleanup: Extract ifs_same_cond tests
UI test cleanup: Extract for_kv_map lint tests
Fix test for rust-lang/rust#57250
Limit infinite_iter collect() check to known types
Some improvements to util documentation
Use hashset for name blacklist
Reformat random_state tests
Use node_id_to_type_opt instead of node_it_to_type in random_state
Check pattern equality while checking declaration equality
random_state lint
Use an FxHashSet for valid idents in documentation lint
Fix suggestion for unnecessary_ref lint
Update CONTRIBUTING.md for rustfix tests
Update .fixed files via update-references.sh
Run rustfix on first UI test
Use WIP branch for compiletest_rs
````

Also updates RLS and removes the patching of rustc_tool_utils from cargo.toml

RLS changes:
````
update clippy hash and rustc_tools_util and use rustc_tools_util from crates.io
Work around https://github.com/rust-lang/rust/pull/55937
Update Clippy... again
Update Clippy
Update clippy
````
r? @oli-obk
2019-01-07 19:44:00 +00:00
dylan_DPC
13f8ad8897 bless you 2019-01-08 00:21:38 +05:30
dylan_DPC
6ddd2cdc5b remove unwanted stage0 line, fix style 2019-01-08 00:21:16 +05:30
dylan_DPC
64a17a0e59 remove unused imports and feature gate from tests 2019-01-08 00:21:07 +05:30
lqd
c075e245de Codegen: run the collector only once
Use the `collect_and_partition_mono_items ` query to avoid calling the collector
2019-01-07 19:48:45 +01:00
dylan_DPC
1ef99f1353 stabilise cfg_attr 2019-01-08 00:17:03 +05:30
Matthias Krüger
c5101b6dff Revert "Auto merge of #57101 - o01eg:fix-57014, r=alexcrichton"
This reverts commit 68614265d3, reversing
changes made to cae623c5ce.

Should fix tools on windows.

Reopens #57014
2019-01-07 18:57:41 +01:00
Matthias Krüger
495fc5ee9d submodules: update rls from 6f5e4bb to 1a6361b
Changes:
````
Update Clippy
Move TestFailures when collecting failures
Update languageserver-types to 0.51.1
update clippy hash and rustc_tools_util and use rustc_tools_util from crates.io
Work around https://github.com/rust-lang/rust/pull/55937
Update Clippy... again
Update Clippy
Update clippy
````
2019-01-07 18:57:21 +01:00
Matthias Krüger
c09d4e7b0f submodules: update clippy from 39bd8449 to c63b6349
Changes:
````
Revert "tests: used_underscore_binding_macro: disable random_state lint."
Revert "Auto merge of #3603 - xfix:random-state-lint, r=phansch"
rustup https://github.com/rust-lang/rust/pull/56837
rustup (don't know the exact PR unfortunately)
Add itertools to integration tests
tests: used_underscore_binding_macro: disable random_state lint.
Trigger `use_self` lint in local macros
Add run-rustfix where it already passes
rustup: https://github.com/rust-lang/rust/pull/55517
Make clippy work with parallel rustc
Add ui/for_kv_map test for false positive in #1279
Update to latest compiletest-rs release
add testcase for #3462
deps: bump rustc_tools_util version from 0.1.0 to 0.1.1 just in case...
Use compiletest's aux-build header instead of include macro
rustc_tool_utils: fix failure to create proper non-repo version string when used in crates on crates.io, bump version
rustfmt
UI test cleanup: Extract ifs_same_cond tests
Extract IteratorFalsePositives into option_helpers.rs
UI test cleanup: Extract for_kv_map lint tests
UI test cleanup: Extract lint from methods.rs test
Fix test for rust-lang/rust#57250
Limit infinite_iter collect() check to known types
Some improvements to util documentation
Use hashset for name blacklist
Reformat random_state tests
Use node_id_to_type_opt instead of node_it_to_type in random_state
Check pattern equality while checking declaration equality
random_state lint
Move constant write checks to temporary_assignment lint
Use an FxHashSet for valid idents in documentation lint
Fix suggestion for unnecessary_ref lint
Update CONTRIBUTING.md for rustfix tests
Update .fixed files via update-references.sh
Run rustfix on first UI test
Use WIP branch for compiletest_rs
````
2019-01-07 18:56:15 +01:00
John Kåre Alsaker
23c742cce7 Rename some functions 2019-01-07 18:50:51 +01:00