Commit Graph

197338 Commits

Author SHA1 Message Date
est31
75d78b9362 Fix tests 2022-08-12 22:26:08 +02:00
est31
6c4fc85f9c Update rustdoc to new slug style 2022-08-12 22:22:55 +02:00
est31
cc6cff564f Replace - with _ in ftl slugs for better grepability
Having to replace - with _ (and vice versa) makes the slugs less greppable
and thus constitutes a contributor roadblock.

Result of running this repeatedly up until reaching a fixpoint:

find compiler/rustc_error_messages/locales/en-US/ -type f -exec sed -i 's/\(.+\)-\(.*\)=/\1_\2=/' {} \;

Plus some fixes to update usages of slugs leading with -.
2022-08-12 22:22:55 +02:00
bors
f22819bcce Auto merge of #100456 - Dylan-DPC:rollup-fn17z9f, r=Dylan-DPC
Rollup of 9 pull requests

Successful merges:

 - #100022 (Optimize thread ID generation)
 - #100030 (cleanup code w/ pointers in std a little)
 - #100229 (add -Zextra-const-ub-checks to enable more UB checking in const-eval)
 - #100247 (Generalize trait object generic param check to aliases.)
 - #100255 (Adding more verbose documentation for `std::fmt::Write`)
 - #100366 (errors: don't fail on broken primary translations)
 - #100396 (Suggest const and static for global variable)
 - #100409 (rustdoc: don't generate DOM element for operator)
 - #100443 (Add two let else regression tests)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-08-12 16:32:24 +00:00
Vadim Petrochenkov
8fa707ab41 rustc_target: Update some old naming around self contained linking
The "fallback" naming pre-dates introduction of `-Clink-self-contained`
2022-08-12 18:47:13 +03:00
Michael Goulet
c6089189b3 Address nit 2022-08-12 15:35:27 +00:00
Michael Goulet
9b0edd099d Adjust span of fn arguments 2022-08-12 15:21:39 +00:00
Michael Goulet
237cbe91a8 Adjust span of closure param 2022-08-12 15:18:40 +00:00
Michael Goulet
262644d94a And for closures 2022-08-12 15:18:40 +00:00
Michael Goulet
20121fa781 Point out a single arg if we have a single arg incompatibility 2022-08-12 15:18:39 +00:00
Michael Woerister
6d030a51dd [debuginfo] Update src/test/debuginfo/mutex.rs for new cpp-like enum debuginfo encoding. 2022-08-12 17:16:55 +02:00
Michael Goulet
6925f4101b Check ctor for missing stability 2022-08-12 15:16:28 +00:00
Michael Goulet
b821ce6097 enum variant ctor inherits stability of variant 2022-08-12 15:15:36 +00:00
Dylan DPC
3bc30bb012
Rollup merge of #100443 - est31:let_else_regression_tests, r=Mark-Simulacrum
Add two let else regression tests

Adds a regression test for #94176, as it was fixed by #98574 but doesn't have a regression test. The PR also incorporates a commit from #94012 which added a test for an issue discovered in that PR.

Originally they have been part of #99291, but I've moved them out in the hopes of getting them merged more quickly, as that PR is already open since a month, and so that #99291 can focus on the drop order part of things.

Closes #94176
Closes #96961 -- dupe of #94176
2022-08-12 20:39:18 +05:30
Dylan DPC
03560346c4
Rollup merge of #100409 - jsha:highlight-lighter, r=GuillaumeGomez
rustdoc: don't generate DOM element for operator

In our source page highlighting, we were generating `<span class="op">` tags for all "operators", including e.g. `<` `>` around generic parameters, `*`, `&`. This contributed significantly to DOM size, but we don't actually style `.op` except in the ayu theme.

Remove the styles for `.op` in ayu, and stop generating the `<span>`s.

This reduces DOM size of an example page[1] from 265,938 HTML elements to 242,165 elements, a 9% reduction.

r? ``@GuillaumeGomez``

Demo: (warning - slow!) https://rustdoc.crud.net/jsha/highlight-lighter/src/core/up/up/stdarch/crates/core_arch/src/x86/avx512f.rs.html

[1]:
https://doc.rust-lang.org/nightly/src/core/up/up/stdarch/crates/core_arch/src/x86/avx512f.rs.html
2022-08-12 20:39:17 +05:30
Dylan DPC
9914c96f06
Rollup merge of #100396 - chenyukang:fix-100394, r=petrochenkov
Suggest const and static for global variable

Fixing #100394
2022-08-12 20:39:16 +05:30
Dylan DPC
9e69dbce19
Rollup merge of #100366 - davidtwco:translation-never-fail, r=compiler-errors
errors: don't fail on broken primary translations

If a primary bundle doesn't contain a message then the fallback bundle is used. However, if the primary bundle's message is broken (e.g. it refers to a interpolated variable that the compiler isn't providing) then this would just result in a compiler panic. While there aren't any primary bundles right now, this is the type of issue that could come up once translation is further along.

r? ```@compiler-errors``` (since this comes out of a in-person discussion we had at RustConf)
2022-08-12 20:39:14 +05:30
Dylan DPC
da3b89d0bf
Rollup merge of #100255 - thedanvail:issue-98861-fix, r=joshtriplett
Adding more verbose documentation for `std::fmt::Write`

Attempts to address #98861
2022-08-12 20:39:13 +05:30
Dylan DPC
caac670a16
Rollup merge of #100247 - cjgillot:verify-dyn-trait-alias-defaults, r=lcnr
Generalize trait object generic param check to aliases.

The current algorithm only checks that `Self` does not appear in defaults for traits.  This is not sufficient for trait aliases.
This PR moves the check to trait object elaboration, which sees through trait aliases.

Fixes https://github.com/rust-lang/rust/issues/82927.
Fixes https://github.com/rust-lang/rust/issues/84789.
2022-08-12 20:39:12 +05:30
Dylan DPC
392ba5f111
Rollup merge of #100229 - RalfJung:extra-const-ub-checks, r=lcnr
add -Zextra-const-ub-checks to enable more UB checking in const-eval

Cc https://github.com/rust-lang/rust/issues/99923
r? `@oli-obk`
2022-08-12 20:39:11 +05:30
Dylan DPC
51eed00ca9
Rollup merge of #100030 - WaffleLapkin:nice_pointer_sis, r=scottmcm
cleanup code w/ pointers in std a little

Use pointer methods (`byte_add`, `null_mut`, etc) to make code in std a little nicer.
2022-08-12 20:39:10 +05:30
Dylan DPC
a8c799a6a0
Rollup merge of #100022 - joboet:faster_threadid, r=joshtriplett
Optimize thread ID generation

By using atomics where available, thread IDs can be generated without locking while still enforcing uniqueness.
2022-08-12 20:39:09 +05:30
bors
0068b8bf4b Auto merge of #100328 - davidtwco:perf-implications, r=nnethercote
passes: load `defined_lib_features` query less

Hopefully addresses the perf regressions from #99212 (see #99905).

Re-structure the stability checks for library features to avoid calling `defined_lib_features` for any more crates than necessary for each of the implications or local feature attributes that need validation.

r? `@ghost` (just checking perf at first)
2022-08-12 13:51:26 +00:00
Maybe Waffle
5fbcde1b55 fill-in tracking issue for feature(iter_array_chunks) 2022-08-12 15:04:29 +04:00
Maybe Waffle
eb6b729545 address review comments 2022-08-12 14:57:15 +04:00
Michael Woerister
ee634fbf0d [debuginfo] Update codegen tests for new cpp-like enum debuginfo encoding. 2022-08-12 12:00:02 +02:00
bors
569788e47e Auto merge of #99624 - vincenzopalazzo:macros/unix_error, r=Amanieu
promote debug_assert to assert when possible and useful

This PR fixed a very old issue https://github.com/rust-lang/rust/issues/94705 to clarify and improve the POSIX error checking, and some of the checks are skipped because can have no benefit, but I'm sure that this can open some interesting discussion.

Fixes https://github.com/rust-lang/rust/issues/94705

cc: `@tavianator`
cc: `@cuviper`
2022-08-12 09:49:55 +00:00
Guillaume Gomez
001cc12af7 remove Clean trait implementation for hir::BareFnTy 2022-08-12 11:40:39 +02:00
Guillaume Gomez
a65647a7f6 remove Clean trait implementation for hir::PathSegment 2022-08-12 11:37:32 +02:00
Goldstein
3fb249bebc
improve "try ignoring the field" diagnostic
Closes #95795
2022-08-12 12:32:43 +03:00
Takayuki Maeda
48c0341a70 suggest removing a semicolon after impl/trait items 2022-08-12 18:11:01 +09:00
Krasimir Georgiev
43eda18a6c adapt test for msan message change
LLVM commit 057cabd997 removed the function from the msan error message. This adapts our test accordingly.

Found via our experimental rust + llvm @ HEAD bot:
https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/12634#018289fe-b0bc-4bab-89b3-fb1d4e38f6db
2022-08-12 08:59:42 +00:00
Michael Woerister
b0e3ed6e8d [debuginfo] Use IndexMap instead of FxHashMap while generating cpp-like generator debuginfo. 2022-08-12 10:53:08 +02:00
Michael Woerister
95d7591478 [debuginfo] Update cpp-like enum decoding docs to account for wrapping tag ranges. 2022-08-12 10:53:08 +02:00
Michael Woerister
171d8a3f57 [debuginfo] Don't mark fields and types as artificial in CPP-like enum debuginfo encoding.
LLDB historically has had problems with "artificial" entries and there
is no real benefit to emitting that flag.
2022-08-12 10:53:08 +02:00
Michael Woerister
8433e2a66f [debuginfo] Remove the notion of a 'fallback variant' from the CPP-like enum debuginfo encoding. 2022-08-12 10:53:08 +02:00
Michael Woerister
dfb2c89e5e [compiletest] Add compiler-bundled NatVis files to test input stamp. 2022-08-12 10:53:07 +02:00
Michael Woerister
8ef0301833 intrinsic.natvis: Add comments, make names more consistent. 2022-08-12 10:53:07 +02:00
Michael Woerister
3a72ea05a0 [debuginfo] Add more test cases cpp-like enum debuginfo. 2022-08-12 10:53:07 +02:00
Michael Woerister
1bbda887ff intrinsic.natvis: Don't access fields from context object in <Intrinsic>.
WinDbg supports that but Visual Studio doesn't. Pass the value as a parameter instead.
2022-08-12 10:53:07 +02:00
Michael Woerister
6875f1272f Remove out-dated NatVis visualizer. 2022-08-12 10:53:07 +02:00
Michael Woerister
725ceae455 Support wrapping 128-bit tag ranges for cpp-like enum debuginfo. 2022-08-12 10:53:07 +02:00
Michael Woerister
063ebfa570 Use enum2<_> instead of enum<_> for Cpp-like debuginfo enum type names.
And add more comments about niche tag enum encoding.
2022-08-12 10:53:07 +02:00
Michael Woerister
622da5d834 debuginfo: Change C++-like encoding for enums.
The updated encoding should be able to handle niche layouts where
more than one variant has fields.
2022-08-12 10:53:07 +02:00
est31
981852677c Add regression test for #94176 2022-08-12 10:03:57 +02:00
Cormac Relf
e3c5bd617d let-else: add a test for warnings on let-else with diverging tail 2022-08-12 10:03:57 +02:00
bors
cc65e1a548 Auto merge of #100435 - ehuss:update-cargo, r=ehuss
Update cargo

8 commits in ce40690a5e4e315d3dab0aae1eae69d0252c52ac..efd4ca3dc0b89929dc8c5f5c023d25978d76cb61
2022-08-09 22:32:17 +0000 to 2022-08-12 01:28:28 +0000
- Use `std:🧵:scope` to replace crossbeam (rust-lang/cargo#10977)
- [docs] Remove extra "in" from `cargo-test.md` (rust-lang/cargo#10978)
- Enable two windows tests (rust-lang/cargo#10930)
- Improve error msg for get target runner (rust-lang/cargo#10968)
- Ensure rustc-echo-wrapper works with an overridden build.target-dir (rust-lang/cargo#10962)
- Switch back to `available_parallelism` (rust-lang/cargo#10969)
- Only override published resolver when the workspace is different (rust-lang/cargo#10961)
- Add `CARGO_LOG` to "Environment variables Cargo reads" (rust-lang/cargo#10967)
2022-08-12 06:45:35 +00:00
Eric Huss
900a9d3f4e Update clippy for introduction of Node::ExprField 2022-08-11 21:56:33 -07:00
Eric Huss
1c70b8669a Fix diagnostic that was looking for a PatKind::Struct
Now that fields are first-class HIR nodes, they appear before the struct pat.
2022-08-11 21:48:39 -07:00
Eric Huss
c655f17bce Add missing visit_pat_field in early lint visitor.
This ensures that lint attributes on pattern fields can control
early lints.
2022-08-11 21:48:39 -07:00