Skip to content
This repository has been archived by the owner on Jan 7, 2022. It is now read-only.

Sync Upstream #152

Merged
merged 397 commits into from
Dec 10, 2020
Merged

Sync Upstream #152

merged 397 commits into from
Dec 10, 2020

Conversation

vext01
Copy link
Member

@vext01 vext01 commented Dec 10, 2020

camsteffen and others added 30 commits November 29, 2020 18:21
Update error to reflect that integer literals can have float suffixes

For example, `1` is parsed as an integer literal, but it can be turned
into a float with the suffix `f32`. Now the error calls them "numeric
literals" and notes that you can add a float suffix since they can be
either integers or floats.
This printed several hundred lines each time rustdoc was run, almost all
of which rounded to 0.000. Since this isn't useful info, don't print it
everywhere, so other perf info is easier to read.
Broken in #79038
... by removing a duplicate `crate_name` field in `interface::Config`,
making it clear that rustdoc should be passing it to `config::Options`
instead.
Respond to comments and start adding tests

Fix re-exports and extern-crate

Add expected output tests

Add restricted paths

Format

Fix: associated methods missing in output

Ignore stripped items

Mark stripped items

removing them creates dangling references

Fix tests and update conversions

Don't panic if JSON backend fails to create a file

Fix attribute error in JSON testsuite

Move rustdoc-json to rustdoc/

This way it doesn't have to build rustc twice. Eventually it should
probably get its own suite, like rustdoc-js, but that can be fixed in a
follow-up.

Small cleanups

Don't prettify json before printing

This fully halves the size of the emitted JSON.

Add comments

[BREAKING CHANGE] rename version -> crate_version

[BREAKING CHANGE] rename source -> span

Use exhaustive matches

Don't qualify imports for DefId

Rename clean::{ItemEnum -> ItemKind}, clean::Item::{inner -> kind}

Fix Visibility conversion

clean::Visability was changed here:
https://github.com/rust-lang/rust/pull/77820/files#diff-df9f90aae0b7769e1eb6ea6f1d73c1c3f649e1ac48a20e169662a8930eb427beL1467-R1509

More churn catchup

Format
Move rustdoc/rustdoc-json to rustdoc-json

Scaffold rustdoc-json test mode

Implement run_rustdoc_json_test

Fix up python

Make tidy happy
Go back to CRATE_DEF_INDEX

Minor niceness improvements

Don't output hidden items

Remove striped items from fields

Add $TEST_BASE_DIR

Small catch
tmandry and others added 10 commits December 9, 2020 13:38
Update LLVM submodule

* [[msan] Fix bugs when instrumenting x86.avx512*_cvt* intrinsics](rust-lang/llvm-project#84)
* [[X86][AVX512] Only lower to VPALIGNR if we have BWI (PR48322)](rust-lang/llvm-project#85)
Remove tab-lock and replace it with ctrl+up/down arrows to switch between search result tabs

Fixes rust-lang/rust#65212

What took the longest time was to update the help popup in the end.

r? `@Manishearth`
Rollup of 12 pull requests

Successful merges:

 - #79732 (minor stylistic clippy cleanups)
 - #79750 (Fix trimming of lint docs)
 - #79777 (Remove `first_merge` from liveness debug logs)
 - #79795 (Privatize some of libcore unicode_internals)
 - #79803 (Update xsv to prevent random CI failures)
 - #79810 (Account for gaps in def path table during decoding)
 - #79818 (Fixes to Rust coverage)
 - #79824 (Strip prefix instead of replacing it with empty string)
 - #79826 (Simplify visit_{foreign,trait}_item)
 - #79844 (Move RWUTable to a separate module)
 - #79861 (Update LLVM submodule)
 - #79862 (Remove tab-lock and replace it with ctrl+up/down arrows to switch between search result tabs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Accept arbitrary expressions in key-value attributes at parse time

Continuation of rust-lang/rust#77271.

We now support arbitrary expressions in values of key-value attributes at parse time.
```
#[my_attr = EXPR]
```
Previously only unsuffixed literals and interpolated expressions (`$expr`) were accepted.

There are two immediate motivational cases for this:
- External doc strings (`#[doc = include_str!("my_doc.md")]`, eliminating the need in rust-lang/rust#44732) and expanding macros in this position in general. Currently such macro expansions are supported in this position in interpolated `$expr`s (the `#[doc = $doc]` idiom).
- Paths (`#[namespace = foo::bar] extern "C++" { ... }`) like proposed in rust-lang/rust#76734.

If the attribute in question survives expansion, then the value is still restricted to unsuffixed literals by a semantic check.
This restriction doesn't prevent the use cases listed above, so this PR keeps it in place for now.

Closes rust-lang/rust#52607.
Previous attempt - rust-lang/rust#67121.
Some more detailed write up on internals - https://internals.rust-lang.org/t/macro-expansion-points-in-attributes/11455.
Tracking issue - rust-lang/rust#78835.
implement better availability probing for copy_file_range

Followup to rust-lang/rust#75428 (comment)

Previously syscall detection was overly pessimistic. Any attempt to copy to an immutable file (EPERM) would disable copy_file_range support for the whole process.

The change tries to copy_file_range on invalid file descriptors which will never run into the immutable file case and thus we can clearly distinguish syscall availability.
Constier maybe uninit

I was playing around trying to make `[T; N]::zip()` in #79451 be `const fn`. One of the things I bumped into was `MaybeUninit::assume_init`. Is there any reason for the intrinsic `assert_inhabited<T>()` and therefore `MaybeUninit::assume_init` not being `const`?

---

I have as best as I could tried to follow the instruction in [library/core/src/intrinsics.rs](https://github.com/rust-lang/rust/blob/master/library/core/src/intrinsics.rs#L11). I have no idea what I am doing but it seems to compile after some slight changes after the copy paste. Is this anywhere near how this should be done?

Also any ideas for name of the feature gate? I guess `const_maybe_assume_init` is quite misleading since I have added some more methods. Should I add test? If so what should be tested?
rustc_codegen_ssa: use bitcasts instead of type punning for scalar transmutes.

This specifically helps with `f32` <-> `u32` (`from_bits`, `to_bits`) in Rust-GPU (`rustc_codegen_spirv`), where (AFAIK) we don't yet have enough infrastructure to turn type punning memory accesses into SSA bitcasts.
(There may be more instances, but the one I've seen myself is `f32::signum` from `num-traits` inspecting e.g. the sign bit)

Sadly I've had to make an exception for `transmute`s between pointers and non-pointers, as LLVM disallows using `bitcast` for them.

r? `@nagisa` cc `@khyperia`
@ltratt
Copy link
Member

ltratt commented Dec 10, 2020

This is a sync I've been looking forward to!

bors r+

bors bot added a commit that referenced this pull request Dec 10, 2020
152: Sync Upstream r=ltratt a=vext01



Co-authored-by: Cameron Steffen <[email protected]>
Co-authored-by: Erik Desjardins <[email protected]>
Co-authored-by: bors <[email protected]>
Co-authored-by: Suyash458 <[email protected]>
Co-authored-by: Joshua Nelson <[email protected]>
Co-authored-by: Matthias Krüger <[email protected]>
Co-authored-by: Vishnunarayan K I <[email protected]>
Co-authored-by: Daiki Ihara <[email protected]>
Co-authored-by: Jethro Beekman <[email protected]>
Co-authored-by: Joseph Ryan <[email protected]>
Co-authored-by: Nixon Enraght-Moony <[email protected]>
Co-authored-by: Bastian Kauschke <[email protected]>
Co-authored-by: Alexis Bourget <[email protected]>
Co-authored-by: Albin Hedman <[email protected]>
Co-authored-by: Yuki Okushi <[email protected]>
Co-authored-by: Eric Huss <[email protected]>
Co-authored-by: Guillaume Gomez <[email protected]>
@bors
Copy link
Contributor

bors bot commented Dec 10, 2020

Build failed:

@ltratt
Copy link
Member

ltratt commented Dec 10, 2020

Those failures look a bit scary to me, so I'll leave this one to you to look at (I was hoping for the tmp dir problem!).

@bjorn3
Copy link
Collaborator

bjorn3 commented Dec 10, 2020

@ltratt
Copy link
Member

ltratt commented Dec 10, 2020

@bjorn3 Oof, yes, I can see those dirs. I'm ... surprised ... that such tests keep getting merged in! I've deleted them so let's see what happens. Thanks for the pointer :)

bors r+

bors bot added a commit that referenced this pull request Dec 10, 2020
152: Sync Upstream r=ltratt a=vext01



Co-authored-by: Cameron Steffen <[email protected]>
Co-authored-by: Erik Desjardins <[email protected]>
Co-authored-by: bors <[email protected]>
Co-authored-by: Suyash458 <[email protected]>
Co-authored-by: Joshua Nelson <[email protected]>
Co-authored-by: Matthias Krüger <[email protected]>
Co-authored-by: Vishnunarayan K I <[email protected]>
Co-authored-by: Daiki Ihara <[email protected]>
Co-authored-by: Jethro Beekman <[email protected]>
Co-authored-by: Joseph Ryan <[email protected]>
Co-authored-by: Nixon Enraght-Moony <[email protected]>
Co-authored-by: Bastian Kauschke <[email protected]>
Co-authored-by: Alexis Bourget <[email protected]>
Co-authored-by: Albin Hedman <[email protected]>
Co-authored-by: Yuki Okushi <[email protected]>
Co-authored-by: Eric Huss <[email protected]>
Co-authored-by: Guillaume Gomez <[email protected]>
@vext01
Copy link
Member Author

vext01 commented Dec 10, 2020

It's this again: rust-lang/rust#79375

@bjorn3 is there any way we can accelerate merging that? We keep hitting this.

We could cherry pick my fixes, but I'd rather it were fixed upstream.

@ltratt
Copy link
Member

ltratt commented Dec 10, 2020

I'm an idiot -- I was looking for something very different in the output, but clearly I wasn't thinking properly!

@bors
Copy link
Contributor

bors bot commented Dec 10, 2020

Build failed:

@ltratt
Copy link
Member

ltratt commented Dec 10, 2020

Hmm, let me try again.

bors r+

bors bot added a commit that referenced this pull request Dec 10, 2020
152: Sync Upstream r=ltratt a=vext01



Co-authored-by: Cameron Steffen <[email protected]>
Co-authored-by: Erik Desjardins <[email protected]>
Co-authored-by: bors <[email protected]>
Co-authored-by: Suyash458 <[email protected]>
Co-authored-by: Joshua Nelson <[email protected]>
Co-authored-by: Matthias Krüger <[email protected]>
Co-authored-by: Vishnunarayan K I <[email protected]>
Co-authored-by: Daiki Ihara <[email protected]>
Co-authored-by: Jethro Beekman <[email protected]>
Co-authored-by: Joseph Ryan <[email protected]>
Co-authored-by: Nixon Enraght-Moony <[email protected]>
Co-authored-by: Bastian Kauschke <[email protected]>
Co-authored-by: Alexis Bourget <[email protected]>
Co-authored-by: Albin Hedman <[email protected]>
Co-authored-by: Yuki Okushi <[email protected]>
Co-authored-by: Eric Huss <[email protected]>
Co-authored-by: Guillaume Gomez <[email protected]>
@bors
Copy link
Contributor

bors bot commented Dec 10, 2020

Build failed:

@ltratt
Copy link
Member

ltratt commented Dec 10, 2020

I'm going to assume that we're running the tests twice, or similar, and that the directories are being recreated during the run. @vext01 what do you want to do?

@vext01
Copy link
Member Author

vext01 commented Dec 10, 2020

@vext01 what do you want to do?

Bjorn has kindly started the merge for the fix.

In the meantime, we ought to be able to get this through, it's just racy.

I've killed the directories in /tmp. Please try again.

@ltratt
Copy link
Member

ltratt commented Dec 10, 2020

bors r+

@bors
Copy link
Contributor

bors bot commented Dec 10, 2020

Build succeeded:

@bors bors bot merged commit d629bca into softdevteam:master Dec 10, 2020
@vext01 vext01 deleted the sync-20201210 branch December 11, 2020 09:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet