Commit graph

167158 commits

Author SHA1 Message Date
bors 1c988cfa0b Auto merge of #96404 - tmandry:roll-llvm, r=cuviper
Update LLVM submodule

* [[fuchsia] Don't include duplicate profiling symbols for Fuchsia
](326efc90ac)
* [[MIPS] Initial support for MIPS-I load delay slots
](161fd6b0b1)

r? `@rust-lang/wg-llvm`
2022-04-26 04:48:33 +00:00
Will Crichton dc41dbaf8e Update unop path, fix tests 2022-04-25 19:14:09 -07:00
bors 9ea4d4127f Auto merge of #96414 - Dylan-DPC:rollup-t4ofhoa, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #90312 (Fix some confusing wording and improve slice-search-related docs)
 - #96149 (Remove unused macro rules)
 - #96279 (rustdoc: Remove .woff font files)
 - #96355 (Better handle too many `#` recovery in raw str)
 - #96379 (delay bug when adjusting `NeverToAny` twice during diagnostic code)
 - #96384 (do not consider two extern types to be similar)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-04-26 01:52:46 +00:00
Will Crichton 4d0fe27896 Replace suggest_constraining_param with suggest_restricting_param_bound
to fix incorrect suggestion for trait bounds involving binary operators.
Fixes #93927, #92347, #93744.
2022-04-25 18:12:15 -07:00
Eric Huss 159b95d5bb Remove references to git.io 2022-04-25 17:05:58 -07:00
Dylan DPC f0b2dccc21
Rollup merge of #96384 - lcnr:extern-types-similar, r=compiler-errors
do not consider two extern types to be similar
2022-04-26 01:21:24 +02:00
Dylan DPC 8038a9ece3
Rollup merge of #96379 - PrestonFrom:issue_96335, r=compiler-errors
delay bug when adjusting `NeverToAny` twice during diagnostic code

Addresses Issue 96335 (https://github.com/rust-lang/rust/issues/96335) by using `delay_span_bug` instead of an assert and returning an error type from `check_expr_meets_expectation_or_error`.

Fixes #96335
2022-04-26 01:21:23 +02:00
Dylan DPC 77031f3d99
Rollup merge of #96355 - estebank:issue-95030, r=compiler-errors
Better handle too many `#` recovery in raw str

Point at all the unnecessary trailing `#`.
Better handle interaction with outer attributes when `;` is missing.

Fix #95030.
2022-04-26 01:21:22 +02:00
Dylan DPC 2381897f27
Rollup merge of #96279 - GuillaumeGomez:remove-woff-fonts, r=camelid,jsha
rustdoc: Remove .woff font files

Copying `@jsha's` great comment:

> Right now we ship 1.5MB of woff files in the rustdoc binary, and 1MB of woff2 files, for a total of 2.5MB.
>
> Per:
>
> https://caniuse.com/woff
> https://caniuse.com/woff2
>
> The only listed browser that supports woff and not woff2 is IE, which is not supported per https://github.com/rust-lang/rfcs/blob/master/text/1985-tiered-browser-support.md.
>
> I propose we stop shipping woff files and save 1.5MB from the rustdoc binary (and from each doc build).

r? `@jsha`
2022-04-26 01:21:21 +02:00
Dylan DPC 93db30aa7f
Rollup merge of #96149 - est31:remove_unused_macro_matchers, r=petrochenkov
Remove unused macro rules

Removes rules of internal macros that weren't triggered.
2022-04-26 01:21:20 +02:00
Dylan DPC 51b86848ff
Rollup merge of #90312 - r00ster91:search, r=Dylan-DPC
Fix some confusing wording and improve slice-search-related docs

This adds more links between `contains` and `binary_search` because I do think they have some relevant connections. If your (big) slice happens to be sorted and you know it, surely you should be using `[3; 100].binary_search(&5).is_ok()` over `[3; 100].contains(&5)`?
This also fixes the confusing "searches this sorted X" wording which just sounds really weird because it doesn't know whether it's actually sorted. It should be but it may not be. The new wording should make it clearer that you will probably want to sort it and in the same sentence it also mentions the related function `contains`.
Similarly, this mentions `binary_search` on `contains`' docs.
This also fixes some other minor stuff and inconsistencies.
2022-04-26 01:21:20 +02:00
bors ec8619dca2 Auto merge of #96294 - Emilgardis:def_id-in-unsafetyviolationdetails, r=oli-obk
Display function path in unsafety violations - E0133

adds `DefId` to `UnsafetyViolationDetails`

this enables consumers to access the function definition that was reported to be unsafe and also changes the output for some E0133 diagnostics
2022-04-25 23:03:50 +00:00
Michael Howell ae38f35720 rustdoc: do not write {{root}} in pub use ::foo docs 2022-04-25 15:38:43 -07:00
Christian Poveda 2e261a82f3
add struct_warn method 2022-04-25 23:49:53 +02:00
Christian Poveda 530f4dce29
remove old code 2022-04-25 23:26:52 +02:00
Christian Poveda 5874b09806
fix formatting 2022-04-25 23:17:32 +02:00
Christian Poveda d6da5fb353
update lockfile 2022-04-25 22:55:24 +02:00
Christian Poveda 519dd8e9de
migrate ambiguous plus diagnostic 2022-04-25 22:55:15 +02:00
Christian Poveda eb55cdce4b
use ParseSess instead of Session in into_diagnostic 2022-04-25 22:54:16 +02:00
Michael Goulet 8a28aa48d2 Fix issue 96381 2022-04-25 13:31:53 -07:00
Tyler Mandry 91f1eaa970 Update LLVM submodule 2022-04-25 12:57:08 -07:00
bors 055bf4ccd5 Auto merge of #96116 - ouz-a:mir-opt, r=oli-obk
Make derefer work everwhere

Follow up work on previous PR's #95649 and #95857.

r? rust-lang/mir-opt

_Co-Authored-By: `@oli-obk_`
2022-04-25 19:34:52 +00:00
Jakob Degen 941e19468a Correct documentation for ShallowInitBox 2022-04-25 14:24:14 -04:00
Aron Parker fc6af819c4 Make EncodeWide implement FusedIterator 2022-04-25 18:38:47 +02:00
bors 18b53cefdf Auto merge of #95604 - nbdd0121:used2, r=petrochenkov
Generate synthetic object file to ensure all exported and used symbols participate in the linking

Fix #50007 and #47384

This is the synthetic object file approach that I described in https://github.com/rust-lang/rust/pull/95363#issuecomment-1079932354, allowing all exported and used symbols to be linked while still allowing them to be GCed.

Related #93791, #95363

r? `@petrochenkov`
cc `@carbotaniuman`
2022-04-25 16:14:54 +00:00
Kjetil Kjeka 5bf5acc324 Add test for asserting correct generation of ptx-kernel args 2022-04-25 16:35:19 +02:00
joboet 54daf496e2
std: directly use pthread in UNIX parker implementation
Mutex and Condvar are being replaced by more efficient implementations, which need thread parking themselves (see #93740). Therefore use the pthread synchronization primitives directly. Also, avoid allocating because the Parker struct is being placed in an Arc anyways.
2022-04-25 15:19:50 +02:00
Gary Guo 6f9b2b3247 Stop exporting rust_eh_personality and friends from cdylib 2022-04-25 14:06:30 +01:00
bors 7417110cef Auto merge of #96246 - SparrowLii:bound_contxet, r=compiler-errors
Add `BoundKind` in `visit_param_bounds` to check questions in bounds

From the FIXME in the impl of `AstValidator`. Better bound checks by adding `BoundCtxt` type parameter to `visit_param_bound`

cc `@ecstatic-morse`
2022-04-25 10:46:58 +00:00
Emil Gardström f71597cb59
avoid fully qualifying error output of issue-43733 test 2022-04-25 11:29:39 +02:00
SparrowLii 74853eedfe simplify describe_field func in borrowck's diagnostics part 2022-04-25 16:09:36 +08:00
bors 756ffb8d0b Auto merge of #95246 - ChrisDenton:command-args, r=joshtriplett
Windows Command: Don't run batch files using verbatim paths

Fixes #95178

Note that the first commit does some minor refactoring (moving command line argument building to args.rs). The actual changes are in the second.
2022-04-25 07:28:09 +00:00
marmeladema e1b074a2a8 Recover most impl Trait and dyn Trait lifetime bound suggestions under NLL 2022-04-25 09:14:44 +02:00
lcnr 5594db0975 do not consider two extern types to be similar 2022-04-25 08:51:26 +02:00
Preston From 5165295452 Delay bug when adjusting NeverToAny twice during diagnostic 2022-04-24 23:52:55 -06:00
bors fedbe5dabc Auto merge of #96106 - jihiggins:issue-96060, r=Mark-Simulacrum
Add type_name info to [TIMING] log output

Adds type_name to the [TIMING] log output:
```
[TIMING] (bootstrap::compile::Sysroot) Sysroot { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } -- 0.020
[TIMING] (bootstrap::builder::Builder::sysroot_libdir::Libdir) Libdir { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } }, target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } -- 0.007
```

Not sure if that's the best way to format it. Thought about replacing the struct's name with the type_name output, but that feels kind of hacky?

Closes #96060
2022-04-25 04:24:10 +00:00
Joshua Nelson 7885ade984 Use build/tmp instead of adding a dependency on tempfile. 2022-04-24 19:40:20 -05:00
Joshua Nelson 12b132dd83 Allow quotes around nixos in /etc/os-release 2022-04-24 19:40:20 -05:00
Joshua Nelson 93c1a941bb Move download-ci-llvm to rustbuild
This attempts to keep the logic as close to the original python as possible.
`probably_large` has been removed, since it was always `True`, and UTF-8 paths are no longer supported when patching files for NixOS.
I can readd UTF-8 support if desired.

Note that this required making `llvm_link_shared` computed on-demand,
since we don't know whether it will be static or dynamic until we download LLVM from CI.
2022-04-24 19:40:13 -05:00
Michael Goulet dff7f25981 suggestion if struct field has method 2022-04-24 16:47:19 -07:00
Michael Goulet 2da65da5a7 pull some methods out of report_method_error 2022-04-24 15:41:20 -07:00
bors 1f631e8e93 Auto merge of #96369 - matthiaskrgr:rollup-q18w4v2, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #95395 (Better error message for `_` in function signature in `impl Trait for Ty`)
 - #96090 (Implement MIR opt unit tests)
 - #96107 ([test] Add test cases for untested functions for VecDeque)
 - #96212 (Use revisions instead of nll compare mode for `/regions/` ui tests)
 - #96215 (Drop support for legacy PM with LLVM 15)
 - #96366 (bootstrap: Remove dead code in rustdoc shim)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-04-24 22:20:56 +00:00
Matthias Krüger f5837f8392
Rollup merge of #96366 - jyn514:remove-dead-code, r=Mark-Simulacrum
bootstrap: Remove dead code in rustdoc shim

The `RUSTDOC_RESOURCE_SUFFIX` variable was never actually set.
2022-04-25 00:11:03 +02:00
Matthias Krüger 433f1f425e
Rollup merge of #96215 - nikic:legacy-pm-removal, r=nagisa
Drop support for legacy PM with LLVM 15

LLVM 15 already removes some of the legacy PM APIs we're using. This patch forces use of NewPM with LLVM 15 (with `-Z new-llvm-pass-manager=no` throwing a warning) and stubs out various FFI methods with a report_fatal_error on LLVM 15.

For LLVMPassManagerBuilderPopulateLTOPassManager() I went with adding our own wrapper, as the alternative would be to muck about with weak symbols, which seems to be non-trivial as far as cross-platform support is concerned (std has `weak!` for this purpose, but only as an internal utility.)

Fixes #96072.
Fixes #96362.
2022-04-25 00:11:02 +02:00
Matthias Krüger 50294f69cd
Rollup merge of #96212 - marmeladema:nll-revisions-regions, r=jackh726
Use revisions instead of nll compare mode for `/regions/` ui tests

Created https://github.com/rust-lang/rust/issues/96211 for the duplicated mismatched types errors

r? `@jackh726`
2022-04-25 00:11:01 +02:00
Matthias Krüger b7e67a6ad9
Rollup merge of #96107 - Gumichocopengin8:test/vec-deque, r=Mark-Simulacrum
[test] Add test cases for untested functions for VecDeque

Added test cases of the following functions
- get
- get_mut
- swap
- reserve_exact
- try_reserve_exact
- try_reserve
- contains
- rotate_left
- rotate_right
- binary_search
- binary_search_by
- binary_search_by_key
2022-04-25 00:11:00 +02:00
Matthias Krüger ddbeda1302
Rollup merge of #96090 - JakobDegen:mir-tests, r=nagisa
Implement MIR opt unit tests

This implements rust-lang/compiler-team#502 .

There's not much to say here, this implementation does everything as proposed. I also added the flag to a bunch of existing tests (mostly those to which I could add it without causing huge diffs due to changes in line numbers). Summarizing the changes to test outputs:
 - Every time an `MirPatch` is created, it adds a cleanup block to the body if it did not exist already. If this block is unused (as is usually the case), it usually gets removed soon after by some pass calling `SimplifyCFG` for unrelated reasons (in many cases this cycle happens quite a few times for a single body). We now run `SimplifyCFG` less often, so those blocks end up in some of our outputs. I looked at changing `MirPatch` to not do this, but that seemed too complicated for this PR. I may still do that in a follow-up.
 - The `InstCombine` test had set `-C opt-level=0` in its flags and so there were no storage markers. I don't really see a good motivation for doing this, so bringing it back in line with what everything else does seems correct.
 - One of the `EarlyOtherwiseBranch` tests had `UnreachableProp` running on it. Preventing that kind of thing is the goal of this feature, so this seems fine.

For the remaining tests for which this feature might be useful, we can gradually migrate them as opportunities present themselves.

In terms of documentation, I plan on submitting a PR to the rustc dev guide in the near future documenting this and other recent changes to MIR. If there's any other places to update, do let me know

r? `@nagisa`
2022-04-25 00:10:59 +02:00
Matthias Krüger 76aa9e5202
Rollup merge of #95395 - compiler-errors:infer-on-impl-for-trait, r=oli-obk
Better error message for `_` in function signature in `impl Trait for Ty`

Provides a replacement suggestion for when `_` is present in the function signature for `impl Trait for Ty`, using the substitutions from the trait to compute the exact type.

Fixes #95097
2022-04-25 00:10:59 +02:00
Michael Goulet 875cd8930e remove indentation in report_method_error 2022-04-24 15:05:06 -07:00
Michael Goulet 319fbe371d Fix suggestion for _ on return type for fn in impl for Trait 2022-04-24 14:50:48 -07:00