Commit Graph

172204 Commits

Author SHA1 Message Date
Ding Xiang Fei
5374688e1d
add tests for async await 2022-07-11 23:20:39 +02:00
Ding Xiang Fei
8e4a971084
extract method to read scrutinee conditionally 2022-07-11 23:20:38 +02:00
Ding Xiang Fei
1cd30e7b32
move else block into the Local struct 2022-07-11 23:20:37 +02:00
Ding Xiang Fei
6c529ded86
lower let-else in MIR instead 2022-07-11 23:20:36 +02:00
est31
3d2494dbf2 Remove box syntax from Box<BareFunctionDecl> construction
The type has 144 bytes according to compiler internal rustdoc.
2022-07-11 22:59:50 +02:00
est31
3fa637dacb Remove box syntax for Box<rustdoc::clean::types::Type> construction
The type has 80 bytes according to compiler internal rustdoc.
2022-07-11 22:58:57 +02:00
est31
88d72a97fc Remove box syntax for Box<ImplItem> construction
ImplItem only has 80 bytes according to compiler internal rustdoc.
2022-07-11 22:58:57 +02:00
est31
ccf1bdbca6 Remove box syntax for Box<Attributes> construction
Attributes only has 48 bytes according to compiler internal rustdoc.
2022-07-11 22:58:57 +02:00
est31
1ac17fcddb Remove box syntax from Box<dyn Iterator> construction
The iterators created should be pretty light weight.
2022-07-11 22:58:57 +02:00
Matthias Krüger
c05e277764
Rollup merge of #99161 - fee1-dead-contrib:compile-test-edition-trim, r=jyn514
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 22:39:10 +02:00
Matthias Krüger
5e223dc7b9
Rollup merge of #99146 - compiler-errors:issue-61525, r=lcnr
Do not error during method probe on `Sized` predicates for types that aren't the method receiver

Fixes #61525

This is safe even though we're skipping an error because we end up confirming the method, which means we're still checking the `Sized` predicate in the end. It just means that we don't emit an erroneous message as below:

```
error: the `query` method cannot be invoked on a trait object
  --> src/lib.rs:14:11
   |
14 |         1.query::<dyn ToString>("")
   |           ^^^^^
   |
   = note: another candidate was found in the following trait, perhaps add a `use` for it:
           `use crate::Example;`
```

Also fixes erroneously suggesting the same trait over again, as seen in the `issue-35976.rs` UI test.
2022-07-11 22:39:09 +02:00
Matthias Krüger
1679d1c622
Rollup merge of #99145 - jyn514:dont-rerun-build-script, r=wesleywiser
Don't rerun the build script for the compiler each time on non-windows platforms

In practice, this doesn't matter very much because the script takes ~no time to run.
But this makes `CARGO_LOG=info` easier to read, and theoretically saves a few milliseconds.
2022-07-11 22:39:08 +02:00
Matthias Krüger
24d241a884
Rollup merge of #99142 - notriddle:notriddle/doctest-multiline-crate-attributes, r=GuillaumeGomez
fix(doctest): treat fatal parse errors as incomplete attributes

Fixes #99089
2022-07-11 22:39:07 +02:00
Matthias Krüger
7151aaf940
Rollup merge of #99124 - compiler-errors:issue-99122, r=oli-obk
Fix sized check ICE in asm check

Fixes (beta nominated, so doesn't close) #99122

1. Moves a check for unresolved inference variables to _before_ other checks that could possibly ICE. We're not changing behavior here, just doing the same thing earlier in the function.
2. Erases region variables in sized check (which are not resolved at this point) because rustc will also ICE when region vars are passed to a query which does not canonicalize them.
2022-07-11 22:39:06 +02:00
Matthias Krüger
d89c183554
Rollup merge of #99075 - danobi:dup_type_hint_sugg, r=petrochenkov
Fix duplicated type annotation suggestion

Before, there was more or less duplicated suggestions to add type hints.
Fix by clearing more generic suggestions when a more specific suggestion
is possible.

This fixes #93506 .
2022-07-11 22:39:05 +02:00
Matthias Krüger
c431e6f15a
Rollup merge of #99055 - GuillaumeGomez:rustdoc-help-options, r=jyn514
Fix rustdoc help options

Fixes #98976.

Since you're the one who found out about the problem and also provided the solution (thanks for both!):

r? ```@jyn514```
2022-07-11 22:39:04 +02:00
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
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