Commit Graph

135587 Commits

Author SHA1 Message Date
Camelid
6aea014fbf
Document InferTy & co. 2020-12-26 17:55:39 -08:00
bors
7e0246552f Auto merge of #80395 - ehuss:lint-docs-warn-missing, r=Mark-Simulacrum
lint-docs: Warn on missing lint when documenting.

In #79522, I missed converting one of the errors to a warning, in the situation where a lint is missing.  This was unearthed by the renaming of overlapping-patterns (#78242).  This will still be validated during the test phase.
2020-12-27 01:21:40 +00:00
David Adler
7adeb710fb Use the hashbrown::{HashMap,HashSet} clone_from impls. 2020-12-26 19:39:38 -05:00
Joshua Nelson
53da233aec Remove FIXME in rustc_privacy 2020-12-26 19:34:10 -05:00
CAD97
eeed3118d0 Use raw version of align_of in rc data_offset
This was missed in #73845 when switching to use the raw operators.
Fixes #80365
2020-12-26 18:37:07 -05:00
bors
0fbc0ce3ab Auto merge of #80396 - ehuss:fix-missing-deny, r=Mark-Simulacrum
Fix missing deny-by-default.md file.

I don't know why, but #80296 deleted this file.  Add it back so that the docs can be viewed directly with mdbook without it auto-generating the file.
2020-12-26 22:35:16 +00:00
Mark Rousskov
fe52a65186 Use package name for top-level directory in bare tarballs
This fixes a bug introduced by #79788.
2020-12-26 17:15:20 -05:00
Eric Huss
6dab9265c8 Fix missing deny-by-default.md file. 2020-12-26 13:53:10 -08:00
Eric Huss
966621563e lint-docs: Warn on missing lint when documenting. 2020-12-26 13:48:09 -08:00
Eric Huss
142764f79e Add links to the source for the rustc and rustdoc books. 2020-12-26 13:22:33 -08:00
Stein Somers
be3a5a1bec BTreeMap: rename the area access methods 2020-12-26 21:43:04 +01:00
bors
0b644e4196 Auto merge of #79045 - oli-obk:dont_rely_on_alloc_happening_for_soundness, r=TimDiekmann
Document that heap allocations are not guaranteed to happen, even if explicitly performed in the code

cc `@RalfJung`
2020-12-26 19:43:12 +00:00
Bastian Kauschke
c4ba60a191 update tests 2020-12-26 18:24:10 +01:00
Bastian Kauschke
18fa7789cd update error codes 2020-12-26 18:24:10 +01:00
Bastian Kauschke
49f890bdb3 delete no longer relevant tests 2020-12-26 18:24:10 +01:00
Bastian Kauschke
06cc9c26da stabilize min_const_generics 2020-12-26 18:24:10 +01:00
oli
efcd8a96c4 DIrect invocations of AllocRef::alloc cannot get optimized away 2020-12-26 17:16:50 +00:00
oli
fba17e3f8d Adjust markdown text to be more like the rendered text 2020-12-26 17:14:49 +00:00
Ralf Jung
8543388beb address review feedback 2020-12-26 18:07:52 +01:00
Oli Scherer
714feab059
Update library/core/src/alloc/mod.rs
Co-authored-by: Ralf Jung <post@ralfj.de>
2020-12-26 18:06:04 +01:00
Oli Scherer
48c8ff59ec
Update library/core/src/alloc/global.rs
Co-authored-by: Ralf Jung <post@ralfj.de>
2020-12-26 18:05:55 +01:00
bors
89524d0f8e Auto merge of #79520 - ssomers:btree_cleanup_1, r=Mark-Simulacrum
BTreeMap: clean up access to MaybeUninit arrays

Stop exposing and using immutable access to `MaybeUninit` slices when we need and have exclusive access to the tree.

r? `@Mark-Simulacrum`
2020-12-26 16:47:33 +00:00
Ralf Jung
3533204e99 clarify wrapping ptr arithmetic docs 2020-12-26 15:59:02 +01:00
bors
30a42735a0 Auto merge of #80354 - ssomers:btree_test_compact, r=Mark-Simulacrum
BTreeMap: test full nodes a little more

r? `@Mark-Simulacrum`
2020-12-26 13:46:16 +00:00
bors
1f5beec3b1 Auto merge of #80316 - ehuss:rustdoc-index, r=Mark-Simulacrum
Include rustdoc in the compiler docs index.

This should help ensure that the index page at https://doc.rust-lang.org/nightly/nightly-rustc/ includes a link to the rustdoc docs as well.

Fixes #80307
2020-12-26 09:29:56 +00:00
bors
780b094d76 Auto merge of #80209 - erikdesjardins:ptrcmp, r=Mark-Simulacrum
Remove pointer comparison from slice equality

This resurrects #71735.

Fixes #71602, helps with #80140.

r? `@Mark-Simulacrum`
2020-12-26 06:43:51 +00:00
bors
733cb54d18 Remove pointer comparison from slice equality
This resurrects #71735.

Fixes #71602, helps with #80140.

r? `@Mark-Simulacrum`
2020-12-26 06:43:51 +00:00
bors
d30dac2d83 Auto merge of #79022 - SpyrosRoum:stabilize-deque_range, r=m-ou-se
stabilize deque_range

Make #74217 stable, stabilizing `VecDeque::range` and `VecDeque::range_mut`.
Pr: #74099

r? `@m-ou-se`
2020-12-26 03:50:16 +00:00
bors
931aa27922 Auto merge of #80246 - matthewjasper:projection-cycle-caching, r=Mark-Simulacrum
Prevent caching normalization results with a cycle

When normalizing a projection which results in a cycle, we would cache the result of `project_type` without the nested obligations (because they're not needed for inference). This would result in the nested obligations only being handled once in fulfill, which would avoid the cycle error. `get_paranoid_cache_value_obligation` used to add an obligation that resulted in a cycle in this case previously, but was removed by #73905.

This PR makes the projection cache not cache the value of a projection if it was ever normalized in a cycle (except in a snapshot that's rolled back).

Fixes #79714.

r? `@nikomatsakis`
2020-12-26 00:11:30 +00:00
bors
1d2730f413 Auto merge of #80366 - Mark-Simulacrum:bump-version, r=Mark-Simulacrum
Bump version to 1.51

r? `@Mark-Simulacrum`
2020-12-25 21:19:11 +00:00
bors
bb178237c5 Auto merge of #80235 - RalfJung:validate-promoteds, r=oli-obk
validate promoteds

Turn on const-value validation for promoteds. This is made possible now that https://github.com/rust-lang/rust/issues/67534 is resolved.

I don't think this is a breaking change. We don't promote any unsafe operation any more (since https://github.com/rust-lang/rust/pull/77526 landed). We *do* promote `const fn` calls under some circumstances (in `const`/`static` initializers), but union field access and similar operations are not allowed in `const fn`. So now is a perfect time to add this check. :D

r? `@oli-obk`
Fixes https://github.com/rust-lang/rust/issues/67465
2020-12-25 18:25:48 +00:00
Mark Rousskov
369449c89b Bump version to 1.51 2020-12-25 10:42:53 -05:00
bors
1832bdd7de Auto merge of #80296 - wesleywiser:revert_missing_fragment_specifier_hard_error, r=Mark-Simulacrum
Revert missing fragment specifier hard error

Closes #76605

Reopens #40107

r? `@Mark-Simulacrum`
2020-12-25 14:09:08 +00:00
bjorn3
dbee13661e Rustfmt 2020-12-25 12:48:19 +01:00
bjorn3
5b32489e72 Set rust-analyzer importMergeBehaviour option to last 2020-12-25 12:47:03 +01:00
bjorn3
2ca8daab42
Merge pull request #1120 from bjorn3/lazy_jit
Lazy compilation in jit mode
2020-12-25 12:40:18 +01:00
bjorn3
35f4a25c6b Add documentation 2020-12-25 12:19:14 +01:00
bors
ab10778854 Auto merge of #80226 - ThePuzzlemaker:issue-80004-fix, r=jyn514,petrochenkov
Highlight edition-specific keywords correctly in code blocks, accounting for code block edition modifiers

Previously, edition-specific keywords (such as `async` and `await`) were not highlighted in code blocks, regardless of what edition was set. With this PR, this issue is fixed.

Now, the following behavior happens:
- When a code block is explicitly set to edition X, keywords from edition X are highlighted
- When a code block is explicitly set to a version that does not contain those keywords from edition X (e.g. edition Y), keywords from edition X are **not** highlighted
- When a code block has no explicit edition, keywords from the edition passed via `--edition` to rustdoc are highlighted

For example, a project set with `edition = "2015"` in its `Cargo.toml` would not highlight `async`/`await` unless the code block was set to `edition2018`. Additionally, a project set with `edition = "2018"` in its `Cargo.toml` *would* highlight `async`/`await` unless the code block was set to a version that did not contain those keywords (e.g. `edition2015`).

This PR fixes #80004.

r? `@jyn514`
2020-12-25 11:16:53 +00:00
bjorn3
3f6a3b5ebe Implement lazy compilation in JIT mode
Lazy compilation has the potential to significantly improve the startup
time of a program. While functions have to be codegened when called, it
is expected that a significant amount of all code is only required when
an error occurs or only when the program is used in certain ways.

The basic approach is to first codegen a shim for each function. This
shim calls the `__cg_clif_jit` function of cg_clif with a pointer to the
`Instance` corresponding to the function for which it is a shim.
`__cg_clif_jit` function then codegens this function and uses the hot
code swapping support of SimpleJIT to redirect future calls to the
function to the real version. Finally it calls the newly codegened
function.
2020-12-25 12:08:21 +01:00
bjorn3
0b9b2532d2 Move finalize CodegenCx timer out of codegen mono items timer 2020-12-25 11:49:50 +01:00
bjorn3
20ffea6b8a Change the way JIT mode is selected 2020-12-25 11:31:33 +01:00
bjorn3
c556e4dd35 Use PIC in JIT mode too 2020-12-25 10:55:11 +01:00
Stein Somers
0d2548a173 BTreeMap: declare exclusive access to arrays when copying from them 2020-12-25 09:33:58 +01:00
bors
198ec340f6 Auto merge of #80187 - 0dvictor:nativelib, r=bjorn3
Exclude unnecessary info from CodegenResults

`foreign_module` and `wasm_import_module` are not needed for linking, and hence can be removed from CodegenResults.

Fixes #77857
2020-12-25 08:17:21 +00:00
bors
9a40539c38 Auto merge of #80364 - Dylan-DPC:rollup-0y96okz, r=Dylan-DPC
Rollup of 11 pull requests

Successful merges:

 - #79213 (Stabilize `core::slice::fill`)
 - #79999 (Refactored verbose print into a function)
 - #80160 (Implemented a compiler diagnostic for move async mistake)
 - #80274 (Rename rustc_middle::lint::LintSource)
 - #80280 (Add installation commands to `x` tool README)
 - #80319 (Fix elided lifetimes shown as `'_` on async functions)
 - #80327 (Updated the match with the matches macro)
 - #80330 (Fix typo in simplify_try.rs)
 - #80340 (Don't unnecessarily override attrs for Module)
 - #80342 (Fix typo)
 - #80352 (BTreeMap: make test cases more explicit on failure)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2020-12-25 05:23:24 +00:00
Dylan DPC
7c7812dfd3
Rollup merge of #80352 - ssomers:btree_test_diagnostics, r=Mark-Simulacrum
BTreeMap: make test cases more explicit on failure

r? `@Mark-Simulacrum`
2020-12-25 03:39:51 +01:00
Dylan DPC
3cf289bd5f
Rollup merge of #80342 - pierwill:patch-1, r=lcnr
Fix typo
2020-12-25 03:39:49 +01:00
Dylan DPC
28267e3839
Rollup merge of #80340 - jyn514:less-modules-attrs, r=GuillaumeGomez
Don't unnecessarily override attrs for Module

They were never changed from the default, which you can get with `tcx.get_attrs()`.
2020-12-25 03:39:48 +01:00
Dylan DPC
704f81e3cb
Rollup merge of #80330 - eltociear:patch-2, r=lcnr
Fix typo in simplify_try.rs

assigment -> assignment
2020-12-25 03:39:46 +01:00
Dylan DPC
2dab627d77
Rollup merge of #80327 - PankajChaudhary5:PankajChaudhary, r=GuillaumeGomez
Updated the match with the matches macro

r?````@GuillaumeGomez````
2020-12-25 03:39:43 +01:00