Commit graph

135988 commits

Author SHA1 Message Date
Camelid
6c86ebab74 Remove FIXME
Co-authored-by: Joshua Nelson <jyn514@gmail.com>
2020-12-30 16:38:31 -08:00
Camelid
75705ab3a9 Update find_nearest_parent_module 2020-12-30 16:38:25 -08:00
bors
f0073a59cf Auto merge of #80435 - pietroalbini:compression-formats, r=Mark-Simulacrum
Only produce .xz tarballs on CI

This PR adds a `./configure` option to choose which tarball compression formats to produce, and changes our CI configuration to only produce `.xz` tarballs. The release process will then recompress everything into `.gz` when producing a release.

This will drastically reduce our storage costs for CI artifacts, as we'd stop storing the same data twice. **Stable, beta and nightly releases will not be affected by this at all.**

Before landing this we'll need to increase the VM size of our release process, to recompress everything in a reasonable amount of time.
r? `@Mark-Simulacrum`
2020-12-31 00:23:13 +00:00
Matthias Krüger
87423fbc6a bootstrap: clippy fixes
addresses:

clippy::or_fun_call
clippy::single_char_add_str
clippy::comparison_to_empty
clippy::or_fun_call
2020-12-31 00:58:52 +01:00
Yuki Okushi
01c6998e6b Move cast-related tests 2020-12-31 08:05:46 +09:00
Yuki Okushi
693f126ca0 Move binop-related tests 2020-12-31 08:04:03 +09:00
Yuki Okushi
50454cf64b Move array-slice-vec-related tests 2020-12-31 08:01:58 +09:00
Yuki Okushi
6871d43d4c Move parser-related tests 2020-12-31 07:53:54 +09:00
Mara Bos
4614cdd230 Fix typos. 2020-12-30 23:23:02 +01:00
Mara Bos
5694b8e471 Don't use doc_comment!{} hack in nonzero_leading_trailing_zeros!{}. 2020-12-30 22:49:08 +01:00
Mara Bos
27b81bf97a Remove all doc_comment!{} hacks by using #[doc = expr] where needed. 2020-12-30 22:49:08 +01:00
bors
9775ffef2a Auto merge of #80530 - m-ou-se:rollup-zit69ko, r=m-ou-se
Rollup of 9 pull requests

Successful merges:

 - #78934 (refactor: removing library/alloc/src/vec/mod.rs ignore-tidy-filelength)
 - #79479 (Add `Iterator::intersperse`)
 - #80128 (Edit rustc_ast::ast::FieldPat docs)
 - #80424 (Don't give an error when creating a file for the first time)
 - #80458 (Some Promotion Refactoring)
 - #80488 (Do not create dangling &T in Weak<T>::drop)
 - #80491 (Miri: make size/align_of_val work for dangling raw ptrs)
 - #80495 (Rename kw::Invalid -> kw::Empty)
 - #80513 (Add regression test for #80062)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2020-12-30 21:25:15 +00:00
max-heller
947b279bc6 Take type defaults into account in suggestions to reorder generic parameters 2020-12-30 16:00:25 -05:00
Mara Bos
8998e31223
Rollup merge of #80513 - LeSeulArtichaut:80062-test, r=lcnr
Add regression test for #80062

Closes #80062.
r? `@lcnr`
2020-12-30 20:57:00 +00:00
Mara Bos
7f44f1d038 Rollup merge of #80495 - jyn514:rename-empty, r=petrochenkov
Rename kw::Invalid -> kw::Empty

See https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Is.20there.20a.20symbol.20for.20the.20empty.20string.3F/near/220054471
for context.

r? `@petrochenkov`
2020-12-30 20:56:58 +00:00
Mara Bos
9e8edc8c22
Rollup merge of #80495 - jyn514:rename-empty, r=petrochenkov
Rename kw::Invalid -> kw::Empty

See https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Is.20there.20a.20symbol.20for.20the.20empty.20string.3F/near/220054471
for context.

r? `@petrochenkov`
2020-12-30 20:56:58 +00:00
Mara Bos
067f1b7030
Rollup merge of #80491 - RalfJung:dangling-of-val, r=oli-obk
Miri: make size/align_of_val work for dangling raw ptrs

This is needed for https://github.com/rust-lang/rust/issues/80365#issuecomment-752128105.

r? `@oli-obk`
2020-12-30 20:56:56 +00:00
Mara Bos
3d93dfdf6e
Rollup merge of #80488 - CAD97:drop-weak-without-reference, r=m-ou-se
Do not create dangling &T in Weak<T>::drop

Since at this point all strong pointers have been dropped, the wrapped `T` has also been dropped. As such, creating a `&T` to the dropped place is negligent at best (language UB at worst). Since we have `Layout::for_value_raw` now, use that instead of `Layout::for_value` to avoid creating the `&T`.

This does have implications for custom (potentially thin) DSTs, though much less severe than those discussed in #80407. Specifically, one of two things has to be true:

- It has to be possible to use a `*const T` to a dropped (potentially custom, potentially thin) unsized tailed object to determine the layout (size/align) of the object. This is what is currently implemented (though with `&T` instead of `&T`). The validity of reading some location after it has been dropped is an open question IIUC (https://github.com/rust-lang/unsafe-code-guidelines/issues/188) (except when the whole type is `Copy`, per `drop_in_place`'s docs).
  In this design, custom DSTs would get a `*mut T` and use that to return layout, and must be able to do so while in the "zombie" (post-drop, pre-free) state.
- `RcBox`/`ArcInner` compute and store layout eagerly, so that they don't have to ask the type for its layout after dropping it.

Importantly, this is already true today, as you can construct `Rc<DST>`, create a `Weak<DST>`, and drop the `Rc` before the `Weak`. This PR is a strict improvement over the status quo, and the above question about potentially thin DSTs will need to be resolved by any custom DST proposal.
2020-12-30 20:56:54 +00:00
Mara Bos
46111c1901
Rollup merge of #80458 - RalfJung:promotion-refactor, r=oli-obk
Some Promotion Refactoring

Clean up promotion a bit:
* factor out some common code
* more exhaustive matches

This *should* not break anything... the only potentially-breaking change is that `BorrowKind::Shallow | BorrowKind::Unique` are now rejected for internal references.

r? ``@oli-obk``
2020-12-30 20:56:52 +00:00
Mara Bos
1975142c97
Rollup merge of #80424 - jyn514:bootstrap-cleanup, r=Mark-Simulacrum
Don't give an error when creating a file for the first time

Previously, `os.remove` would always give a FileNotFound error the first
time you called it, causing bootstrap to make unnecessary copies. This
now only calls `remove()` if the file exists, avoiding the unnecessary
error.

This is a pretty small cleanup but I think it's useful. Taken from https://github.com/rust-lang/rust/pull/79540.
2020-12-30 20:56:51 +00:00
Mara Bos
3d7cdf667e
Rollup merge of #80128 - pierwill:pierwill-docs-fieldpat, r=jyn514
Edit rustc_ast::ast::FieldPat docs

Punctuation fixes.
2020-12-30 20:56:49 +00:00
Mara Bos
9cf24388d1
Rollup merge of #79479 - camelid:intersperse, r=m-ou-se
Add `Iterator::intersperse`

This is a rebase of #75784. I'm hoping to push this past the finish line!

cc `@jonas-schievink`
2020-12-30 20:56:47 +00:00
Mara Bos
242a252687
Rollup merge of #78934 - DeveloperC286:issue_60302_vec, r=m-ou-se
refactor: removing library/alloc/src/vec/mod.rs ignore-tidy-filelength

This PR removes the need for ignore-tidy-filelength for library/alloc/src/vec/mod.rs which is part of the issue #60302

It is probably easiest to review this PR by looking at it commit by commit rather than looking at the overall diff.
2020-12-30 20:56:45 +00:00
Camelid
40bbb7fad4 Add tracking issue 2020-12-30 12:07:28 -08:00
Jonas Schievink
7786a6b334 Add Iterator::intersperse 2020-12-30 12:07:19 -08:00
Tyler Mandry
26daa65662 Update LLVM
- [GlobalISel][IRTranslator] Fix a crash when the use of an extractvalue is a non-dominated metadata use.
- [asan] Use dynamic shadow memory position on Apple Silicon macOS
2020-12-30 19:14:15 +00:00
bors
e226704685 Auto merge of #80511 - Mark-Simulacrum:bump-stage0, r=pietroalbini
Bump bootstrap compiler to 1.50 beta

r? `@pietroalbini`
2020-12-30 18:32:31 +00:00
mark
40bf3c0f09 Implement edition-based macro pat feature 2020-12-30 09:57:49 -06:00
Mara Bos
16834a8f52
Fix rustdoc link in vec/into_iter.rs. 2020-12-30 15:35:02 +00:00
bors
507bff92fa Auto merge of #80510 - JohnTitor:rollup-gow7y0l, r=JohnTitor
Rollup of 7 pull requests

Successful merges:

 - #80185 (Fix ICE when pointing at multi bytes character)
 - #80260 (slightly more typed interface to panic implementation)
 - #80311 (Improvements to NatVis support)
 - #80337 (Use `desc` as a doc-comment for queries if there are no doc comments)
 - #80381 (Revert "Cleanup markdown span handling")
 - #80492 (remove empty wraps, don't return Results from from infallible functions)
 - #80509 (where possible, pass slices instead of &Vec or &String (clippy::ptr_arg))

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2020-12-30 15:30:56 +00:00
LeSeulArtichaut
78498d0d45 Add regression test for #80062 2020-12-30 16:26:56 +01:00
Pietro Albini
5526d90250
bootstrap: extract from any compression algorithm during distcheck 2020-12-30 16:20:23 +01:00
Joshua Nelson
5479bbaf72 Rename kw::Invalid -> kw::Empty
See https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Is.20there.20a.20symbol.20for.20the.20empty.20string.3F/near/220054471
for context.
2020-12-30 09:50:02 -05:00
Joshua Nelson
edeac1778c Rename kw::Invalid -> kw::Empty
See https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Is.20there.20a.20symbol.20for.20the.20empty.20string.3F/near/220054471
for context.
2020-12-30 09:50:02 -05:00
Mark Rousskov
fe031180d0 Bump bootstrap compiler to 1.50 beta 2020-12-30 09:27:19 -05:00
Yuki Okushi
41fa0dba27
Rollup merge of #80509 - matthiaskrgr:ptr_arg, r=varkor
where possible, pass slices instead of &Vec or &String (clippy::ptr_arg)
2020-12-30 22:49:26 +09:00
Yuki Okushi
07083739fb
Rollup merge of #80492 - matthiaskrgr:tasty_wraps, r=varkor
remove empty wraps, don't return Results from from infallible functions

This makes code easier to understand because it is more obvious when a function actually can't fail (return Err or None)

Make functions that only ever return Some(x), return x directly
Remove return type from functions that return Option<(), Err> but would only ever return Ok(()).

Found with `clippy::unnecessary_wraps`
2020-12-30 22:49:24 +09:00
Yuki Okushi
7494aef979
Rollup merge of #80381 - rust-lang:revert-80244-spans, r=GuillaumeGomez
Revert "Cleanup markdown span handling"

Reverts rust-lang/rust#80244. This caused a diagnostic regression, originally it was:

```
warning: unresolved link to `std::process::Comman`
 --> link.rs:3:10
  |
3 | //! [a]: std::process::Comman
  |          ^^^^^^^^^^^^^^^^^^^^ no item named `Comman` in module `process`
  |
  = note: `#[warn(broken_intra_doc_links)]` on by default
```
but after that PR rustdoc now displays
```
warning: unresolved link to `std::process::Comman`
 --> link.rs:1:14
  |
1 | //! Links to [a] [link][a]
  |              ^^^ no item named `Comman` in module `process`
  |
  = note: `#[warn(broken_intra_doc_links)]` on by default
```
which IMO is much less clear.

cc `@bugadani,` thanks for catching this in https://github.com/rust-lang/rust/pull/77859.
r? `@GuillaumeGomez`
2020-12-30 22:49:23 +09:00
Yuki Okushi
18ac1ecac9
Rollup merge of #80337 - jyn514:add-query-desc, r=varkor
Use `desc` as a doc-comment for queries if there are no doc comments

This at least gives *some* idea of what the query does even if it's not very readable. Some examples:

![image](https://user-images.githubusercontent.com/23638587/103021399-13e15c00-4518-11eb-8121-940774ae2fd1.png)
![image](https://user-images.githubusercontent.com/23638587/103021448-222f7800-4518-11eb-8ee6-cc10795fdc22.png)
![image](https://user-images.githubusercontent.com/23638587/103021434-1d6ac400-4518-11eb-885b-59d00c57bc70.png)

I want to turn `{}` into either `_` or the stringified expr, but [I'm not sure how to do that](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/Evaluate.20format.20string.20in.20proc-macro). In the meantime, this is better than having no docs at all.
2020-12-30 22:49:21 +09:00
Yuki Okushi
88b198b727
Rollup merge of #80311 - sivadeilra:natvis, r=petrochenkov
Improvements to NatVis support

NatVis files describe how to display types in some Windows debuggers,
such as Visual Studio, WinDbg, and VS Code.

This commit makes several improvements:

* Adds visualizers for Rc<T>, Weak<T>, and Arc<T>.

* Changes [size] to [len], for consistency with the Rust API.
  Visualizers often use [size] to mirror the size() method on C++ STL
  collections.

* Several visualizers used the PVOID and ULONG typedefs. These are part
  of the Windows API; they are not guaranteed to always be defined in a
  pure Rust DLL/EXE. I converted PVOID to `void*` and `ULONG` to
  `unsigned long`.

* Cosmetic change: Removed {} braces around the visualized display
  for `Option` types. They now display simply as `Some(value)` or
  `None`, which reflects what is written in source code.

* The visualizer for `alloc::string::String` makes assumptions about
  the layout of `String` (it casts `String*` to another type), rather
  than using symbolic expressions. This commit changes the visualizer
  so that it simply uses symbolic expressions to access the string
  data and string length.

* The visualizers for `str` and `String` now place the character data
  array under a synthetic `[chars]` node. When expanding a `String`
  node, users rarely want to see an array of characters. This just places
  them behind one expansion node / level.
2020-12-30 22:49:19 +09:00
Yuki Okushi
00741b8810
Rollup merge of #80260 - RalfJung:less-untyped-panics, r=m-ou-se
slightly more typed interface to panic implementation

The panic payload is currently being passed around as a `usize`. However, it actually is a pointer, and the involved types are available on all ends of this API, so I propose we use the proper pointer type to avoid some casts. Avoiding int-to-ptr casts also makes this code work with `miri -Zmiri-track-raw-pointers`.
2020-12-30 22:49:17 +09:00
Yuki Okushi
1caa5b00d5
Rollup merge of #80185 - JohnTitor:issue-80134, r=davidtwco
Fix ICE when pointing at multi bytes character

Fixes #80134

Seems this ICE was introduced by #73953, checking width of span to avoid ICE.
2020-12-30 22:49:16 +09:00
Yuki Okushi
4ae99cc843 Fix ICE when pointing at multi bytes character 2020-12-30 22:33:13 +09:00
Ralf Jung
f76bae9244 CTFE: test size/align_of_val_raw on dangling pointers 2020-12-30 14:29:33 +01:00
bors
bbcaed03bf Auto merge of #79684 - usbalbin:const_copy, r=oli-obk
Make copy[_nonoverlapping] const

Constifies
* `intrinsics::copy` and `intrinsics::copy_nonoverlapping`
* `ptr::read` and `ptr::read_unaligned`
  * `*const T::read` and `*const T::read_unaligned`
  * `*mut T::read` and `*mut T::read_unaligned`
* `MaybeUninit::assume_init_read`
2020-12-30 12:43:02 +00:00
Matthias Krüger
e5ead5fc58 remove unused return types such as empty Results or Options that would always be Some(..)
remove unused return type of dropck::check_drop_obligations()
don't wrap return type in Option in get_macro_by_def_id() since we would always return Some(..)
remove redundant return type of back::write::optimize()
don't Option-wrap return type of compute_type_parameters() since we always return Some(..)
don't return empty Result in assemble_generator_candidates()
don't return empty Result in assemble_closure_candidates()
don't return empty result in assemble_fn_pointer_candidates()
don't return empty result in assemble_candidates_from_impls()
don't return empty result in assemble_candidates_from_auto_impls()
don't return emtpy result in assemble_candidates_for_trait_alias()
don't return empty result in assemble_builtin_bound_candidates()
don't return empty results in assemble_extension_candidates_for_traits_in_scope() and assemble_extension_candidates_for_trait()
remove redundant wrapping of return type of StripItem::strip() since it always returns Some(..)
remove unused return type of assemble_extension_candidates_for_all_traits()
2020-12-30 13:15:40 +01:00
Matthias Krüger
bdc9291ed9 where possible, pass slices instead of &Vec or &String (clippy::ptr_arg) 2020-12-30 13:11:52 +01:00
bors
d107a87d34 Auto merge of #80503 - JohnTitor:rollup-b26vglu, r=JohnTitor
Rollup of 13 pull requests

Successful merges:

 - #79812 (Lint on redundant trailing semicolon after item)
 - #80348 (remove redundant clones (clippy::redundant_clone))
 - #80358 (Edit rustc_span documentation)
 - #80457 (Add missing commas to `rustc_ast_pretty::pp` docs)
 - #80461 (Add llvm-libunwind change to bootstrap CHANGELOG)
 - #80464 (Use Option::map_or instead of open coding it)
 - #80465 (Fix typo in ffi-pure.md)
 - #80467 (More uses of the matches! macro)
 - #80469 (Fix small typo in time comment)
 - #80472 (Use sans-serif font for the "all items" page links)
 - #80477 (Make forget intrinsic safe)
 - #80482 (don't clone copy types)
 - #80487 (don't redundantly repeat field names)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2020-12-30 09:51:42 +00:00
Yuki Okushi
3812909919
Rollup merge of #80487 - matthiaskrgr:field_names, r=jyn514
don't redundantly repeat field names

r? `@Dylan-DPC`
2020-12-30 18:15:29 +09:00
Yuki Okushi
039b62e888
Rollup merge of #80482 - matthiaskrgr:cl0ne_on_copy, r=jyn514
don't clone copy types

r? `@Dylan-DPC`
2020-12-30 18:15:27 +09:00