Commit Graph

149735 Commits

Author SHA1 Message Date
Mara Bos
e735f6086d Add test for ref suggestions in macros. 2021-06-02 18:36:05 +02:00
Camille GILLOT
0e71283495 Restrict access to crate_name.
Also remove original_crate_name, which had the exact same implementation
2021-06-02 18:35:32 +02:00
Mara Bos
80828f26bb Improve check_ref suggestions in macros. 2021-06-02 18:11:32 +02:00
Ryan Levick
ab419314e9 Add a page on force-warns in unstable book 2021-06-02 18:07:39 +02:00
Ryan Levick
dc2db73899 Add deny-by-default test 2021-06-02 17:25:24 +02:00
Ryan Levick
e3e31a1912 Add missing stderr file 2021-06-02 17:22:24 +02:00
Ryan Levick
8d4841cf0e Add final test 2021-06-02 17:18:52 +02:00
Tomasz Miąsko
11478bd614 Validate type of locals used as indices 2021-06-02 17:11:07 +02:00
hi-rustin
957e2effc3 Address comment 2021-06-02 23:10:55 +08:00
Tomasz Miąsko
c898681a86 Add Ty::is_union predicate and use it 2021-06-02 17:09:17 +02:00
Tomasz Miąsko
012c323467 Implement Ty::is_enum using matches! 2021-06-02 17:09:13 +02:00
Ryan Levick
3b206b7a70 Force warn on lint groups as well 2021-06-02 17:09:07 +02:00
Wesley Wiser
3127419e2b Respond to review feedback 2021-06-02 10:23:12 -04:00
Wesley Wiser
ef053fd6f0 Change the type name from _enum<..> to enum$<..>
This makes the type name inline with the proposed standard in #85269.
2021-06-02 10:23:12 -04:00
Wesley Wiser
d2d6fa852d Respond to review feedback 2021-06-02 10:23:11 -04:00
Wesley Wiser
d650091117 Make tidy happy 2021-06-02 10:23:11 -04:00
Wesley Wiser
2a9fa202fe Add/update tests 2021-06-02 10:23:11 -04:00
Wesley Wiser
141546c355 Generate better debuginfo for niche-layout enums
Previously, we would generate a single struct with the layout of the
dataful variant plus an extra field whose name contained the value of
the niche (this would only really work for things like `Option<&_>`
where we can determine that the `None` case maps to `0` but for enums
that have multiple tag only variants, this doesn't work).

Now, we generate a union of two structs, one which is the layout of the
dataful variant and one which just has a way of reading the
discriminant. We also generate an enum which maps the discriminant value
to the tag only variants.

We also encode information about the range of values which correspond to
the dataful variant in the type name and then use natvis to determine
which union field we should display to the user.

As a result of this change, all niche-layout enums render correctly in
WinDbg and Visual Studio!
2021-06-02 10:23:10 -04:00
Wesley Wiser
2a025c1a76 Remove fallback for containing scopes
This wasn't necessary for msvc and caused issues where different types
with the same name such as different instantiations of `Option<T>` would
have colliding debuginfo. This confused the debugger which would pick
one of the type definitions and use for all types with that name even
though they had different layout.
2021-06-02 10:23:10 -04:00
Wesley Wiser
b644f06326 Resolve EnumTagInfo FIXME 2021-06-02 10:23:10 -04:00
Wesley Wiser
f353cbf1a1 Generate better debuginfo for directly tagged enums 2021-06-02 10:23:09 -04:00
bors
2f601ef527 Auto merge of #85337 - cjgillot:less-anon, r=michaelwoerister
Avoid creating anonymous nodes with zero or one dependency.

Anonymous nodes are only useful to encode dependencies, and cannot be replayed from one compilation session to another.
As such, anonymous nodes without dependency are always green.
Anonymous nodes with only one dependency are equivalent to this dependency.

cc #45408
cc `@michaelwoerister`
2021-06-02 13:11:41 +00:00
Camille Gillot
4e3b220b02
Update compiler/rustc_metadata/src/rmeta/mod.rs
Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
2021-06-02 14:00:49 +02:00
bors
1e13a9bb33 Auto merge of #85892 - tmiasko:i, r=oli-obk
Miscellaneous inlining improvements
2021-06-02 10:47:58 +00:00
Muhammad Mominul Huque
507d97b26e Update expressions where we can use array's IntoIterator implementation 2021-06-02 16:09:04 +06:00
Muhammad Mominul Huque
01d4d46f66 Replace IntoIter::new with IntoIterator::into_iter in std 2021-06-02 16:09:04 +06:00
bors
7350f655ef Auto merge of #85908 - cjgillot:private-dep-query, r=Aaron1011
Make is_private_dep a query.

Part of #85153

r? `@Aaron1011`
2021-06-02 08:06:45 +00:00
Tomasz Miąsko
c1f6495b8e Miscellaneous inlining improvements 2021-06-02 08:49:58 +02:00
bors
d20b9add05 Auto merge of #85905 - cjgillot:one-trait-map, r=Aaron1011
Only compute the trait map once

Part of #85153

r? `@Aaron1011`
2021-06-02 05:25:41 +00:00
Eric Huss
7852935175 Update cargo 2021-06-01 20:38:39 -07:00
bors
c4f186f0ea Auto merge of #85687 - m-ou-se:new-prelude, r=yaahc
New prelude

RFC: rust-lang/rfcs#3114
Tracking issue: https://github.com/rust-lang/rust/issues/85684
2021-06-02 02:36:44 +00:00
csmoe
521d9ab59a convert Rvalue::threadlocalref assertion to delay bug 2021-06-02 10:19:57 +08:00
Luqman Aden
f667aca127 Tweak wasm_base target spec to indicate linker is not GNU and update linker inferring logic for wasm-ld. 2021-06-01 17:13:10 -07:00
Jubilee Young
d03683caf6 Allow raw pointers in SIMD types 2021-06-01 17:00:44 -07:00
bors
153f22a906 Auto merge of #85331 - cjgillot:dirty-dancing, r=Aaron1011
Make rustc_dirty/clean annotations exhaustive by default

Fixes #45009
2021-06-01 23:02:52 +00:00
LingMan
e2b22b56b8 Use pattern matching instead of checking lengths explicitly
This piece of code checks that there are exaclty two variants, one having
exactly one field, the other having exactly zero fields. If any of these
conditions is violated, it returns `None`. Otherwise it assigns that one
field's ty to `field_ty`.

Instead of fiddling with indices and length checks explicitly, use pattern
matching to simplify this.
2021-06-01 22:31:46 +02:00
Rich Kadel
f4f76e60b3 Reland - Report coverage 0 of dead blocks
Fixes: #84018

With `-Z instrument-coverage`, coverage reporting of dead blocks
(for example, blocks dropped because a conditional branch is dropped,
based on const evaluation) is now supported.

Note, this PR relands an earlier, reverted PR that failed when compiling
generators. The prior issues with generators has been resolved and a new
test was added to prevent future regressions.

Check out the resulting changes to test coverage of dead blocks in the
test coverage reports in this PR.
2021-06-01 13:28:59 -07:00
bors
625d5a693e Auto merge of #85829 - bjorn3:simplify_crate_num, r=jackh726
Remove CrateNum::ReservedForIncrCompCache

It's only use is easily replaceable with `Option<CrateNum>`.
2021-06-01 20:09:03 +00:00
Camille GILLOT
93b25bd293 Make trait_map an Option. 2021-06-01 21:59:48 +02:00
Camille GILLOT
b51f24f021 Make the reasoning more explicit. 2021-06-01 21:46:30 +02:00
Camille GILLOT
3a6d5c2beb Avoid creating anonymous nodes with zero or one dependency. 2021-06-01 21:43:30 +02:00
Tilmann Meyer
965997b369
Support Android ndk versions r23-beta3 and up
Since android ndk version `r23-beta3`, `libgcc` has been replaced with
`libunwind`. This moves the linking of `libgcc`/`libunwind` into the
`unwind` crate where we check if the system compiler can find
`libunwind` and fall back to `libgcc` if needed.
2021-06-01 21:37:50 +02:00
Guillaume Gomez
98a9b02e92 Don't generate impl-items div container if there is none 2021-06-01 21:36:03 +02:00
Tilmann Meyer
971a3f15f0
Update compiler_builtins to 0.1.44 2021-06-01 21:32:29 +02:00
Camille GILLOT
ba0ac88cd5 Avoid a clone of output_filenames. 2021-06-01 21:22:55 +02:00
Guillaume Gomez
93389b5568 Remove invalid usage of aria-level 2021-06-01 21:19:28 +02:00
Guillaume Gomez
9077d540da Replace h3 and h4 containing invalid DOM 2021-06-01 21:19:28 +02:00
Guillaume Gomez
42312501d0 Add missing <title> in redirection page <head> 2021-06-01 21:19:27 +02:00
Guillaume Gomez
7414d28e0b Replace empty href with "#" 2021-06-01 21:19:27 +02:00
Camille GILLOT
202d39a96b Drop metadata_encoding_version. 2021-06-01 21:12:27 +02:00