127080 Commits

Author SHA1 Message Date
MaulingMonkey
7cbfbd3ee7 compiletest: Introduce "min-cdb-version" 2020-09-05 14:46:22 -07:00
bors
cdc8f0606d Auto merge of #76217 - RalfJung:maybe-uninit-slice, r=KodrAus
rename MaybeUninit slice methods

The `first` methods conceptually point to the whole slice, not just its first element, so rename them to be consistent with the raw ptr methods on ref-slices.

Also, do the equivalent of https://github.com/rust-lang/rust/pull/76047 for the slice reference getters, and make them part of https://github.com/rust-lang/rust/issues/63569 (so far they somehow had no tracking issue).

* first_ptr -> slice_as_ptr
* first_ptr_mut -> slice_as_mut_ptr
* slice_get_ref -> slice_assume_init_ref
* slice_get_mut -> slice_assume_init_mut
2020-09-05 21:02:18 +00:00
Caleb Cartwright
1ceb82488f Update RLS and Rustfmt 2020-09-05 15:40:07 -05:00
bors
e9440cbcde Auto merge of #5997 - giraffate:fix_fp_about_clone_in_same_item_push, r=ebroto
Fix FP in `same_item_push`

Don't emit a lint when the pushed item doesn't have Clone trait

Fix #5979

changelog: Fix FP in `same_item_push` not to emit a lint when the pushed item doesn't have Clone trait
2020-09-05 20:27:17 +00:00
Rich Kadel
39a35178d3 Update llvm-project to include PR 73
https://github.com/rust-lang/llvm-project/pull/73
2020-09-05 12:49:17 -07:00
bors
de921ab3c3 Auto merge of #75428 - the8472:fix-copy-eopnotsupp, r=joshtriplett
Workarounds for copy_file_range issues

fixes #75387
fixes #75446
2020-09-05 19:09:22 +00:00
Edd Barrett
8af85fa1f7 Improve the documentation of filter() and filter_map().
I believe the documentation is currently a little misleading.

For example, in the docs for `filter()`:

> If the closure returns `false`, it will try again, and call the closure on
> the next element, seeing if it passes the test.

This kind of implies that if the closure returns true then we *don't* "try
again" and no further elements are considered. In actuality that's not the
case, every element is tried regardless of what happened with the previous
element.

This change tries to clarify that by removing the uses of "try again"
altogether.
2020-09-05 19:59:30 +01:00
Joshua Nelson
cd72d9029f Find the first segment that failed to resolve for _any_ namespace
Moves this detection into `resolution_failure` to avoid doing
unnecessary work and make the control flow a little easier to work with.
2020-09-05 13:56:57 -04:00
Joshua Nelson
8318a185f3 x.py bless 2020-09-05 13:56:57 -04:00
Joshua Nelson
efdc3facdf Give a much better error message when an item has a macro disambiguator
Previously, this called `check_full_res` for values and types, but not
macros. This would result in not showing when there was a partial
resolution for a parent of the item.

This now calls `check_full_res`. Additionally, it checks if there was a
disambiguator, and if so, says that specific kind wasn't found instead
of saying generically 'associated item'.
2020-09-05 13:56:57 -04:00
Joshua Nelson
ee683ef853 Say 'prefix with kind@' instead of 'prefix with the item kind'
This is both more specific and easier to read.
2020-09-05 13:56:55 -04:00
Vadim Petrochenkov
8754884b78 rustbuild: Do not use rust-mingw component when bootstrapping windows-gnu targets 2020-09-05 20:49:59 +03:00
Joshua Nelson
d67eb1f148 Don't suggest \[ \] if there's a :: in the path 2020-09-05 13:48:20 -04:00
Joshua Nelson
f2826d9e9b Show the first path segment which failed to resolve.
Before, it would arbitrarily pick the third-to-last if the last three or
more did not resolve.
2020-09-05 13:48:19 -04:00
Joshua Nelson
bb9d157604 Address my own review comments
- Remove unneeded lifetime parameter
- Comment why some code doesn't use `check_full_res`
2020-09-05 13:48:19 -04:00
Joshua Nelson
2ca6f11663 Fix rebase conflicts 2020-09-05 13:48:19 -04:00
Joshua Nelson
418f6089e9 Give a better error message when linking to a macro with the wrong disambiguator
Before:

```
warning: unresolved link to `m`
 --> m.rs:1:6
  |
1 | /// [value@m]
  |      ^^^^^^^
  |
  = note: `#[warn(broken_intra_doc_links)]` on by default
  = note: no item named `m` is in scope
  = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
```

After:

```
warning: unresolved link to `m`
 --> m.rs:1:6
  |
1 | /// [value@m]
  |      ^^^^^^^ help: to link to the macro, use its disambiguator: `m!`
  |
  = note: `#[warn(broken_intra_doc_links)]` on by default
  = note: this link resolves to the macro `m`, which is not in the value namespace
```
2020-09-05 13:48:19 -04:00
Joshua Nelson
6875220e1a Use rustc_resolve's descr() instead of rewriting it 2020-09-05 13:48:19 -04:00
Joshua Nelson
ebc8cb470f Turn NoParentItem from a panic into an ICE 2020-09-05 13:48:19 -04:00
Joshua Nelson
19d100278d Fix failures to resolve primitives
Previously, when looking for the associated items for primitives,
rustdoc would look for primitives in the current namespace.
But all primitives are in the type namespace. To fix this, rustdoc now
always looks for primitives in the namespace when considering them as a
stepping stone to the associated item.

However, fixing that bug caused several duplicate errors because rustdoc
now reports the same error in each namespace. To avoid this, rustdoc now
ignores all duplicate errors when issuing them.
2020-09-05 13:48:19 -04:00
Joshua Nelson
e2d69f2eb1 Make errors more concise and helpful
Before:
```
   = note: this link partially resolves to the struct `S`
   = note: no `fmt` in `S`
```

After:
```
   = note: the struct `S` has no field or associated item named `fmt`
```
2020-09-05 13:48:19 -04:00
Joshua Nelson
7b8d0befd6 Remove some TODOs 2020-09-05 13:48:19 -04:00
Joshua Nelson
002d3a922c Don't give misleading errors for f::A, where f is in the value namespace 2020-09-05 13:48:19 -04:00
Joshua Nelson
f4e6ebd11a Fix tests and improve error message if :: isn't found 2020-09-05 13:48:19 -04:00
Joshua Nelson
42bed03500 Pass on the DefId so rustdoc can name it in suggestions
Look at this beauty:

```rust
error: unresolved link to `S::h`
  --> intra-link-errors.rs:51:6
   |
51 | /// [type@S::h]
   |      ^^^^^^^^^ help: to link to the associated function, use its disambiguator: `S::h()`
   |
   = note: this link resolves to the associated function `h`, which is not in the type namespace
```
2020-09-05 13:48:19 -04:00
Joshua Nelson
fcb21999a7 Report if the thing exists in another namespace 2020-09-05 13:48:19 -04:00
Joshua Nelson
4ace4e7520 Use fewer .to_string()s 2020-09-05 13:48:19 -04:00
Joshua Nelson
f45e7b5862 Update .stderr 2020-09-05 13:48:19 -04:00
Joshua Nelson
3797f29aad [WIP] give better errors for broken intra doc links 2020-09-05 13:48:19 -04:00
Vadim Petrochenkov
4fff14d3d8 rustbuild: Remove Mode::Codegen 2020-09-05 20:34:03 +03:00
bors
04f44fb923 Auto merge of #75872 - mati865:pgo-tests, r=petrochenkov
Enable some of profiler tests on Windows-gnu

CC https://github.com/rust-lang/rust/issues/61266

Because of force-push GitHub didn't let me reopen https://github.com/rust-lang/rust/pull/75184

Because of the GCC miscompilation, generated binaries either segfault or `.profraw` is malformed. Clang works fine but we can't use it on the CI.
However we can still test the IR for the proper instrumentation so let's do it.
2020-09-05 17:18:26 +00:00
Ralf Jung
35068326b5 document remaining unsafety in maybe_uninit.rs 2020-09-05 17:24:22 +02:00
Ralf Jung
cff5f56886 rename MaybeUninit slice methods
first_ptr -> slice_as_ptr
first_ptr_mut -> slice_as_mut_ptr
slice_get_ref -> slice_assume_init_ref
slice_get_mut -> slice_assume_init_mut
2020-09-05 17:24:22 +02:00
Takayuki Nakata
96b31a5b36 Fix FP when coercion kicks in 2020-09-06 00:02:35 +09:00
bors
7d289aeade Auto merge of #76376 - Dylan-DPC:rollup-8chsbw9, r=Dylan-DPC
Rollup of 11 pull requests

Successful merges:

 - #75695 (Add a regression test for issue-72793)
 - #75741 (Refactor byteorder to std in rustc_middle)
 - #75954 (Unstable Book: add links to tracking issues for FFI features)
 - #75994 (`impl Rc::new_cyclic`)
 - #76060 (Link vec doc to & reference)
 - #76078 (Remove disambiguators from intra doc link text)
 - #76082 (Fix intra-doc links on pub re-exports)
 - #76254 (Fold length constant in Rvalue::Repeat)
 - #76258 (x.py check checks tests/examples/benches)
 - #76263 (inliner: Check for codegen fn attributes compatibility)
 - #76285 (Move jointness censoring to proc_macro)

Failed merges:

r? @ghost
2020-09-05 14:59:32 +00:00
Dylan DPC
85cee57fd7
Rollup merge of #76285 - matklad:censor-spacing, r=petrochenkov
Move jointness censoring to proc_macro

Proc-macro API currently exposes jointness in `Punct` tokens. That is,
`+` in `+one` is **non** joint.

Our lexer produces jointness info for all tokens, so we need to censor
it *somewhere*

Previously we did this in a lexer, but it makes more sense to do this
in a proc-macro server.

r? @petrochenkov
2020-09-05 16:28:36 +02:00
Dylan DPC
b4d3873024
Rollup merge of #76263 - tmiasko:inline-codegen-fn-attrs, r=ecstatic-morse
inliner: Check for codegen fn attributes compatibility

* Check for target features compatibility
* Check for no_sanitize attribute compatibility

Fixes #76259.
2020-09-05 16:28:34 +02:00
Dylan DPC
45bdee8fde
Rollup merge of #76258 - Mark-Simulacrum:check-tests, r=ehuss
x.py check checks tests/examples/benches

This also adds a check for bootstrap to x.py.

r? @ehuss
2020-09-05 16:28:32 +02:00
Dylan DPC
79b8f59185
Rollup merge of #76254 - tmiasko:fold-len, r=wesleywiser
Fold length constant in Rvalue::Repeat

Fixes #76248.
2020-09-05 16:28:30 +02:00
Dylan DPC
f1eb5f800f
Rollup merge of #76082 - jyn514:top-level-links, r=ollie27,GuillaumeGomez
Fix intra-doc links on pub re-exports

Partial fix for https://github.com/rust-lang/rust/issues/76073 - This removes the incorrect error, but doesn't show the documentation anywhere.
r? @GuillaumeGomez
2020-09-05 16:28:28 +02:00
Dylan DPC
ed39e6d60a
Rollup merge of #76078 - jyn514:no-disambiguator, r=manishearth
Remove disambiguators from intra doc link text

Closes https://github.com/rust-lang/rust/issues/65354.
r? @Manishearth

The commits are mostly atomic, but there might be some mix between them here and there. I recommend reading 'refactor ItemLink' and 'refactor RenderedLink' on their own though, lots of churn without any logic changes.
2020-09-05 16:28:26 +02:00
Dylan DPC
86cf7976e2
Rollup merge of #76060 - pickfire:patch-12, r=jyn514
Link vec doc to & reference

It is not always obvious that people could see the docs for `&`
especially for beginners, it also helps learnability.
2020-09-05 16:28:24 +02:00
Dylan DPC
4bd3f266b0
Rollup merge of #75994 - mental32:impl-rc-new-cyclic, r=KodrAus
`impl Rc::new_cyclic`

References #75861

r? @Dylan-DPC
2020-09-05 16:28:22 +02:00
Dylan DPC
c3a09fba84
Rollup merge of #75954 - ArekPiekarz:unstable_book_ffi_tracking_issues, r=steveklabnik
Unstable Book: add links to tracking issues for FFI features
2020-09-05 16:28:20 +02:00
Dylan DPC
e160d2b3e0
Rollup merge of #75741 - workingjubilee:refactor-byteorder, r=matthewjasper
Refactor byteorder to std in rustc_middle

Use std::io::{Read, Write} and {to, from}_{le, be}_bytes methods in
order to remove byteorder from librustc_middle's dependency graph.
2020-09-05 16:28:17 +02:00
Dylan DPC
cb33a15c3e
Rollup merge of #75695 - JohnTitor:regression-test, r=Dylan-DPC
Add a regression test for issue-72793

Adds a regression test for #72793, which is fixed by #75443. Note that this won't close the issue as the snippet still shows ICE with `-Zmir-opt-level=2`. But it makes sense to add a test anyway.
2020-09-05 16:28:16 +02:00
Mara Bos
e56ea68db5 Add compile_fail test for SyncOnceCell's dropck issue. 2020-09-05 15:55:20 +02:00
Ivan Tham
d80415a3bf
Improve ayu doc source line number contrast
Improve contrast of foreground line number.
2020-09-05 21:08:35 +08:00
Mara Bos
578e714393 Fix dropck issue of SyncOnceCell.
Fixes #76367.
2020-09-05 14:10:10 +02:00
Ayush Kumar Mishra
5a0a58bbef Added str tests in library 2020-09-05 17:18:45 +05:30