Commit Graph

172519 Commits

Author SHA1 Message Date
Matthias Krüger
601c5a2087
Rollup merge of #97210 - Milo123459:clippy-args, r=jyn514
Support `-A`, `-W`, `-D` and `-F` when running `./x.py clippy`

Resolves #97059

This PR adds support for `-A`, `-W`, `-D` and `-F` when running `./x.py clippy`.
2022-07-11 22:39:03 +02:00
bors
8a3325496f Auto merge of #96978 - lqd:win_pgo2, r=Mark-Simulacrum
Utilize PGO for windows x64 rustc dist builds

This PR adds PGO support for the CI x64 windows dist builds.

These are the results from running the rustc-perf benchmarks:
![image](https://user-images.githubusercontent.com/247183/177662869-683a8034-7c95-42bf-9900-9ffd66677fcf.png)

Thanks to `@Kobzol,` `@michaelwoerister,` `@wesleywiser,` `@Mark-Simulacrum` for their precious help.
2022-07-11 20:32:06 +00:00
Vadim Petrochenkov
8d9fdb778e rustc_target: Flip the default for TargetOptions::executables to true
Also change `executables` to true for linux-kernel and windows-uwp-gnu targets
2022-07-11 23:23:51 +03:00
Jane Losare-Lusby
655d6e82e3 apply suggestions from code review 2022-07-11 19:18:56 +00:00
Michael Goulet
5c6560f2d5 Fix sized check ICE in intrisicck 2022-07-11 17:57:02 +00:00
bors
38b72154de Auto merge of #98637 - cjgillot:bare-trait-anon-lt, r=petrochenkov
Create fresh lifetime parameters for bare fn trait too

The current code fails to account for the equivalence between `dyn FnMut(&mut u8)` and bare `FnMut(&mut u8)`, and treated them differently.

This PR introduces a special case for `Fn` traits, which are always fully resolved.

Fixes #98616
Fixes #98726
This will require a beta-backport, as beta contains that bug.

r? `@petrochenkov`
2022-07-11 17:09:37 +00:00
Deadbeef
29c128ad11 compiletest: trim edition before passing as flag
This makes `edition: 2021` work instead of the ugly
`edition:2021` one has to write.
2022-07-11 16:53:41 +00:00
Oli Scherer
3338593afd Only check relative sizes on platform specific types 2022-07-11 15:41:38 +00:00
Oli Scherer
0318b70514 tidy 2022-07-11 14:35:04 +00:00
Oli Scherer
cdd6bba8f6 Simplify size checking 2022-07-11 14:23:32 +00:00
Oli Scherer
d935c70afa Don't allow accidental runtime-checks 2022-07-11 14:16:14 +00:00
Rémy Rakic
9027f82536 introduce PGO on the dist-x86_64-msvc builder
This adds windows-specific behavior into the PGO script, and enables it
on CI.
2022-07-11 15:55:31 +02:00
Rémy Rakic
736dbefaf3 make linux PGO script more generic
This extracts the linux-isms into variables, so that the script can be
extended to do PGO on windows. These variables will be overriden in a
few spots, in windows-specific blocks.
2022-07-11 15:53:46 +02:00
Jack Huey
988e754691
placeholders -> inference vars in comment 2022-07-11 09:52:25 -04:00
Amanieu d'Antras
dfe68eede3 Add test for issue 99071 2022-07-11 14:47:22 +01:00
Rémy Rakic
9dd6f5246c extend bootstrap for PGO on windows
When building LLVM/LLD as part of a build that asks LLVM to generate profiles, e.g. when
doing PGO, cmake or clang-cl don't automatically link clang's profiler runtime in,
causing undefined reference errors at link-time.

We do that manually, by adding clang's resource library folder to the library search path:
- for LLVM itself, by extending the linker args that `rustc_llvm`'s build script
  uses, to avoid the linker errors when linking `rustc_driver`.
- for LLD, by extending cmake's linker flags during the LLD build step.
2022-07-11 15:43:28 +02:00
Rose Hudson
d84f7394a4 use PlaceRef::iter_projections to fix old FIXME
I added this function in 53481a5a8f
2022-07-11 14:42:49 +01:00
Amanieu d'Antras
e51f1b7e27 Keep unstable target features for asm feature checking
Inline assembly uses the target features to determine which registers
are available on the current target. However it needs to be able to
access unstable target features for this.

Fixes #99071
2022-07-11 14:26:58 +01:00
Rémy Rakic
94f8ee1f7c bump CI LLVM to 14.0.5
The version 14.0.2 we currently use is busted on windows at the very
least.
2022-07-11 15:20:46 +02:00
Guillaume Gomez
20b5c739d1 Continue themes CSS migration over CSS variables 2022-07-11 15:01:09 +02:00
Guillaume Gomez
01b4b60eae Remove unused CSS rules 2022-07-11 15:01:09 +02:00
bors
9fb32dc924 Auto merge of #99151 - Dylan-DPC:rollup-40aqkxy, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #98882 (explain doc comments in macros a bit)
 - #98907 (Deny float const params even when `adt_const_params` is enabled)
 - #99091 (Do not mention private types from other crates as impl candidates)
 - #99140 (Implement `SourceMap::is_span_accessible`)
 - #99147 (Mention similarly named associated type even if it's not clearly in supertrait)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-07-11 12:16:20 +00:00
Oli Scherer
8440208eb1 tidy 2022-07-11 11:07:03 +00:00
Oli Scherer
fcd7207d0e Make tests work on 32 bit and 64 bit 2022-07-11 10:43:47 +00:00
Oli Scherer
9a204509d2 Show sizes in error output 2022-07-11 10:34:01 +00:00
Oli Scherer
fef596f6a2 Rename assertion macro 2022-07-11 10:31:21 +00:00
Oli Scherer
af8536e32f Simplify assertion macro 2022-07-11 10:30:50 +00:00
Oli Scherer
3f4cf59323 Move checks to compile-time 2022-07-11 10:29:02 +00:00
Oli Scherer
984db78d77 Hide niches in SIMD types, too 2022-07-11 10:25:41 +00:00
Oli Scherer
423915590b More obvious closure name 2022-07-11 10:11:28 +00:00
Dylan DPC
21d6b1fc0e
Rollup merge of #99147 - compiler-errors:issue-55673, r=lcnr
Mention similarly named associated type even if it's not clearly in supertrait

Due to query cycle avoidance, we sometimes restrict the candidates in `complain_about_assoc_type_not_found` too much so that we can't detect typo replacements from just supertraits.

This creates a more general note of the existence of a similarly named associated type from _all_ visible traits when possible.

Fixes #55673
2022-07-11 15:19:33 +05:30
Dylan DPC
9fc297a2ae
Rollup merge of #99140 - TaKO8Ki:implement-is-accessible-span, r=fee1-dead
Implement `SourceMap::is_span_accessible`

This patch adds `SourceMap::is_span_accessible` and replaces `span_to_snippet(span).is_ok()` and `span_to_snippet(span).is_err()` with it. This removes a `&str` to `String` conversion.
2022-07-11 15:19:32 +05:30
Dylan DPC
93f71d4e01
Rollup merge of #99091 - compiler-errors:private-types-should-stay-private, r=lcnr
Do not mention private types from other crates as impl candidates

Fixes #99080
2022-07-11 15:19:31 +05:30
Dylan DPC
92b8adf8e0
Rollup merge of #98907 - compiler-errors:plz-no-float, r=oli-obk
Deny float const params even when `adt_const_params` is enabled

Supersedes #98825
Fixes #98813

r? ``@oli-obk``
2022-07-11 15:19:30 +05:30
Dylan DPC
943152008f
Rollup merge of #98882 - compiler-errors:explain-doc-comments-in-macros, r=davidtwco
explain doc comments in macros a bit

Open to suggestions on improving this... macro parsing is very foreign to me.

Should we have a structured suggestion to turn them into their regular non-doc comments?

Fixes #92846
Fixes #97850
2022-07-11 15:19:29 +05:30
bors
7d1f57a757 Auto merge of #97841 - nvzqz:inline-encode-wide, r=thomcc
Inline Windows `OsStrExt::encode_wide`

User crates currently produce much more code than necessary because the optimizer fails to make assumptions about this method.
2022-07-11 09:30:54 +00:00
Guillaume Gomez
b65d3a6ef2 Add tests for -Chelp and -Zhelp 2022-07-11 11:27:35 +02:00
Guillaume Gomez
992346d7bd Fix rustdoc -Zhelp and -Chelp options 2022-07-11 10:58:05 +02:00
Pietro Albini
6bc97d0adc
configure nightly branch name in stage0.json 2022-07-11 10:15:13 +02:00
Pietro Albini
b6df2a70f0
remove the need to update bump-stage0 with new stage0 config fields 2022-07-11 10:13:35 +02:00
Takayuki Maeda
018155c3a2 rename a method 2022-07-11 16:51:19 +09:00
Lucas Dumont
07a0fd2c1e Add std::fs::write documentation precision
As mentioned in #97947, the documentation is updated
2022-07-11 09:48:47 +02:00
Milo
e3d84b2809 clippy argument support 2022-07-11 07:42:10 +00:00
SOFe
01a9ff0e85
Clarify that [iu]size bounds were only defined for the target arch 2022-07-11 15:08:38 +08:00
Michael Goulet
913023b6b4 Use Visibility::is_accessible_from to make suggestion more specific 2022-07-11 07:06:18 +00:00
Nicholas Nethercote
10144e29af Handle tags better.
Currently, for the enums and comparison traits we always check the tag
for equality before doing anything else. This is a bit clumsy. This
commit changes things so that the tags are handled very much like a
zeroth field in the enum.

For `eq`/ne` this makes the code slightly cleaner.

For `partial_cmp` and `cmp` it's a more notable change: in the case
where the tags aren't equal, instead of having a tag equality check
followed by a tag comparison, it just does a single tag comparison.

The commit also improves how `Hash` works for enums: instead of having
duplicated code to hash the tag for every arm within the match, we do
it just once before the match.

All this required replacing the `EnumNonMatchingCollapsed` value with a
new `EnumTag` value.

For fieldless enums the new code is particularly improved. All the code
now produced is close to optimal, being very similar to what you'd write
by hand.
2022-07-11 16:58:32 +10:00
Michael Goulet
f2d8af10c2 Do not mention private Self types from other crates 2022-07-11 06:57:48 +00:00
Michael Goulet
680fef4d04 Mention similarly named associated type even if it's not clearly in supertrait 2022-07-11 06:53:11 +00:00
bors
2682b88c52 Auto merge of #98369 - jyn514:configure.py, r=Mark-Simulacrum
Remove unsupported options in configure.py

I've seen people using `optimize = false` and `full-bootstrap = true` in the past, without knowing
that they're not recommended. Remove `optimize` and a few other options that are always a bad idea,
and document that full-bootstrap is only for testing reproducible builds.
2022-07-11 06:37:20 +00:00
Michael Goulet
88f2140d87 Do not suggest same trait over again 2022-07-11 05:23:08 +00:00