Commit Graph

134838 Commits

Author SHA1 Message Date
Mara Bos
2bc5d44ca9 Fix outdated comment about not needing to flush stderr. 2020-12-08 22:57:49 +01:00
bors
1700ca07c6 Auto merge of #79727 - tmiasko:8bit-rwu, r=lcnr
Compress RWU from at least 32 bits to 4 bits

The liveness uses a mixed representation of RWUs based on the
observation that most of them have invalid reader and invalid
writer. The packed variant uses 32 bits and unpacked 96 bits.
Unpacked data contains reader live node and writer live node.

Since live nodes are used only to determine their validity,
RWUs can always be stored in a packed form with four bits for
each: reader bit, writer bit, used bit, and one extra padding
bit to simplify packing and unpacking operations.
2020-12-08 20:58:20 +00:00
Mara Bos
5cab04ea92 Remove deprecated linked_list_extras methods. 2020-12-08 20:52:57 +01:00
Eric Arellano
989edf4a5f Review feedback
* Use a match statement.
* Clarify why we can't use `file_stem()`.
* Error if the `:` is missing for Tidy error codes, rather than no-oping.
2020-12-08 12:51:00 -07:00
Matthias Krüger
20f8538d1f simplify if let Some(_) = x to if x.is_some() (clippy::redundant_pattern_matching) 2020-12-08 20:27:49 +01:00
Matthias Krüger
c37e19843a don't create owned values for comparison (clippy::cmp_owned) 2020-12-08 20:27:48 +01:00
Matthias Krüger
0fa461558c use .contains() or .any() instead of find(x).is_some() (clippy::search_is_some) 2020-12-08 20:27:48 +01:00
Matthias Krüger
dbe3acfaeb don't wrap code block in Ok() (clipppy::unit_arg) 2020-12-08 20:27:48 +01:00
Aaron Hill
a332e2b38f
Account for gaps in def path table during decoding
When encoding a proc-macro crate, there may be gaps in the table (since
we only encode the crate root and proc-macro items). Account for this by
checking if the entry is present, rather than using `unwrap()`
2020-12-08 13:02:53 -05:00
LingMan
7654b12112 Simplify visit_{foreign,trait}_item
Using an `if` seems like a better semantic fit and saves a few lines.
2020-12-08 15:56:15 +01:00
bors
5e6e1e33a1 Auto merge of #79817 - LingMan:if_map, r=lcnr
Replace simple `if let` constructs with Option::map

Replaces a few constructs of the form

```
if let Some(x) = var {
    Some(...)
} else {
    None
}
```

with calls to `Option::map`.

`@rustbot` modify labels +C-cleanup +T-compiler
2020-12-08 13:58:15 +00:00
LingMan
06aa7a7601 Strip prefix instead of replacing it with empty string 2020-12-08 14:46:19 +01:00
bors
5019791e2d Auto merge of #79752 - cjgillot:dead-alien, r=lcnr
Visit ForeignItems when marking dead code

Follow-up to #79318

r? `@lcnr`
2020-12-08 11:16:19 +00:00
Bastian Kauschke
4fb9f1d784 fix unsoundness in make_contiguous 2020-12-08 10:34:31 +01:00
bors
4fd4a98d47 Auto merge of #79806 - LeSeulArtichaut:fixup-filter-is-none, r=jyn514
Fixup: `filter().is_none()` -> `!any()`
2020-12-08 08:51:51 +00:00
Camille GILLOT
37853f925f Visit ForeignItems when marking dead code. 2020-12-08 08:07:55 +01:00
bors
5e48ea9a40 Auto merge of #79712 - JohnTitor:test-issue-66286, r=estebank
Add a regression test for issue-66286

Fixes #66422
2020-12-08 06:25:31 +00:00
bors
79132506d1 Auto merge of #79820 - ehuss:update-cargo, r=ehuss
Update cargo

10 commits in 63d0fe43449adcb316d34d98a982b597faca4178..d274fcf862b89264fa2c6b917b15230705257317
2020-12-02 01:44:30 +0000 to 2020-12-07 23:08:44 +0000
- Clarify cargo manifest edition field docs (rust-lang/cargo#8953)
- Run rustdoc doctests relative to the workspace (rust-lang/cargo#8954)
- Workaround fs issue in `cargo publish`. (rust-lang/cargo#8950)
- Fix panic with -Zbuild-std and no roots. (rust-lang/cargo#8942)
- Slightly optimize `cargo vendor` (rust-lang/cargo#8937)
- Fixes rust-lang/cargo#8783 , cargo new fails without a author name or email (rust-lang/cargo#8912)
- Fix test escaping __CARGO_TEST_ROOT (rust-lang/cargo#8929)
- Add period to allowed feature name characters. (rust-lang/cargo#8932)
- faq: small fixes (rust-lang/cargo#8931)
- Fix semver documentation tests. (rust-lang/cargo#8930)
2020-12-08 03:43:39 +00:00
Eric Huss
9eacdb5a77 Update cargo 2020-12-07 18:35:06 -08:00
Rich Kadel
95c268f64d Fixes to Rust coverage
Fixes: #79725

Some macros can create a situation where `fn_sig_span` and `body_span`
map to different files.

New documentation on coverage tests incorrectly assumed multiple test
binaries could just be listed at the end of the `llvm-cov` command,
but it turns out each binary needs a `--object` prefix.

This PR fixes the bug and updates the documentation to correct that
issue. It also fixes a few other minor issues in internal implementation
comments, and adds documentation on getting coverage results for doc
tests.
2020-12-07 17:56:19 -08:00
Eric Arellano
a3174de9ff Fix net.rs - rsplitn() returns a reverse iterator 2020-12-07 18:47:10 -07:00
Eric Arellano
f68cc68e79 Review feedback for collect_intra_doc_links.rs
* Add assertion value is defined.
* Simplify comment.
* Fix bad change in err message.
2020-12-07 18:47:10 -07:00
LingMan
af9402af0f Replace simple if let constructs with Option::map
Replaces a few constructs of the form

if let Some(x) = var {
    Some(...)
} else {
    None
}

with calls to Option::map.
2020-12-08 02:40:14 +01:00
bors
d4aea0b749 Auto merge of #79780 - camelid:use-summary_opts, r=GuillaumeGomez
Use `summary_opts()` in another spot

I added `summary_opts()` before I cut the branch for #77686 (2 months
ago!), so this "slipped through the cracks".
2020-12-08 01:15:26 +00:00
Albin Hedman
077527170b Make write and slice_as_[mut_]_ptr const 2020-12-08 00:07:34 +01:00
Albin Hedman
174935988f Make assume_init_{ref,mut} const 2020-12-08 00:05:26 +01:00
bors
bda05cc471 Auto merge of #79653 - tmiasko:naked-functions, r=Amanieu
Validate naked functions definitions

Validate that naked functions are defined in terms of a single inline assembly
block that uses only `const` and `sym` operands and has `noreturn` option.

Implemented as future incompatibility lint with intention to migrate it into
hard error. When it becomes a hard error it will ensure that naked functions are
either unsafe or contain an unsafe block around the inline assembly. It will
guarantee that naked functions do not reference functions parameters (obsoleting
part of existing checks from #79411). It will limit the definitions of naked
functions to what can be reliably supported. It will also reject naked functions
implemented using legacy LLVM style assembly since it cannot satisfy those
conditions.

https://github.com/rust-lang/rfcs/pull/2774
https://github.com/rust-lang/rfcs/pull/2972
2020-12-07 22:47:20 +00:00
Eric Arellano
d2de69da2e Dogfood 'str_split_once()` in the std lib 2020-12-07 14:24:05 -07:00
Eric Arellano
85e9ea0152 Dogfood 'str_split_once() with librustdoc 2020-12-07 14:00:31 -07:00
Eric Arellano
7bd47bd7a1 Dogfood 'str_split_once() with linkchecker 2020-12-07 14:00:21 -07:00
LeSeulArtichaut
9cc563b70b Fixup: filter().is_none() -> !any() 2020-12-07 21:40:20 +01:00
Albin Hedman
69ab0bcabf Use 'error-pattern' in ui test 2020-12-07 21:26:09 +01:00
bors
3d6705aa5a Auto merge of #79797 - jethrogb:sgx-fix-79038, r=Mark-Simulacrum
Fix SGX CI, take 3

Broken in #79038

r? `@Mark-Simulacrum`

I actually ran `./x.py test --target x86_64-fortanix-unknown-sgx` on the commit before submitting it this time.
2020-12-07 20:25:24 +00:00
Eric Arellano
d6baf3875c Dogfood 'str_split_once() with Tidy 2020-12-07 12:54:55 -07:00
Eric Arellano
12db2225b6 Dogfood 'str_split_once() with compiler/ 2020-12-07 12:48:44 -07:00
Albin Hedman
bdda98aaba
Add comment for assert_inhabited in compiler/rustc_mir/src/interpret/intrinsics.rs
Co-authored-by: Ralf Jung <post@ralfj.de>
2020-12-07 18:59:10 +01:00
Joshua Nelson
0ee3f6d7ef Update xsv to prevent random CI failures
This fixes occasional proptest failures due to a bug in xsv, which
aren't related to bugs in the rust compiler.
2020-12-07 12:51:28 -05:00
bors
afa995b2dd Auto merge of #79751 - aDotInTheVoid:json-true-idx, r=jyn514
Rustdoc: Use correct def_id for doctree::Import

The default overwrites the crate root, which crashes rustdoc-json.

While investigating this, It turns out somehow, some items are being documented twice. I'm not sure how this is happening but for now, we just make sure they were the same if they have the same id.

[Zulip descussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Panic.20in.20json-format/near/218899256)

[Bless script](https://gist.github.com/aDotInTheVoid/2dfce0d241338def3f033f941b7c183d) (Once this is more pollished I'll submit it)

r? `@jyn514`
2020-12-07 17:35:02 +00:00
Eduard-Mihai Burtescu
97c7022d08 rustc_codegen_ssa: use bitcasts instead of type punning for scalar transmutes. 2020-12-07 18:19:43 +02:00
bors
b5ff9c3d05 Auto merge of #79773 - lcnr:type-visitor, r=oli-obk
small `TypeVisitor` refactor

cc `@LeSeulArtichaut` `@scottmcm`

adds `ControlFlow::map_break`
2020-12-07 15:07:09 +00:00
Bastian Kauschke
e3e4870bce small TypeVisitor refactor 2020-12-07 15:52:59 +01:00
Jethro Beekman
9703bb8192 Fix SGX CI, take 3
Broken in #79038
2020-12-07 15:22:34 +01:00
Aleksey Kladov
88da5682c3 Privatize some of libcore unicode_internals
My understanding is that these API are perma unstable, so it doesn't
make sense to pollute docs & IDE completion[1] with them.

[1]: https://github.com/rust-analyzer/rust-analyzer/issues/6738
2020-12-07 16:16:42 +03:00
bors
2b76c48328 Auto merge of #79772 - ethanboxx:79760-wrongly-speaks-of-methods, r=oli-obk
smarter E0390

Should fix #79760

I am fairly new to the compiler so am hoping I did things correctly :).
2020-12-07 09:28:25 +00:00
bors
e5721a5283 Auto merge of #79641 - sourcefrog:split-example, r=dtolnay
Add a doctest example of str::split on a slice of chars

This is mentioned as supported, but the semantics are not described.
2020-12-07 06:05:34 +00:00
Camelid
2ee34a0923 Use summary_opts() in another spot
I added `summary_opts()` before I cut the branch for #77686 (2 months
ago!), so this "slipped through the cracks".
2020-12-06 18:52:36 -08:00
Tomasz Miąsko
8065dabd17 Validate naked functions definitions 2020-12-07 00:00:00 +00:00
bors
f00ace93d0 Auto merge of #79776 - petrochenkov:mvtest, r=Mark-Simulacrum
Move some tests to subdirectories

Mostly tests related to imports.
(A couple of very outdated tests is also deleted.)

Part of https://github.com/rust-lang/rust/issues/73494.
2020-12-07 00:00:00 +00:00
Aman Arora
d9523622ff Move handling UpvarRef to PlaceBuilder
- This allows us to delay figuring out the index of a capture
  in the closure structure when all projections to atleast form
  a capture have been applied to the builder

Co-authored-by: Roxane Fruytier <roxane.fruytier@hotmail.com>
2020-12-06 18:30:23 -05:00
Vadim Petrochenkov
4eb9da3b17 Move some tests to subdirectories 2020-12-07 02:25:09 +03:00