Commit Graph

199527 Commits

Author SHA1 Message Date
Michael Goulet
fd2766e7fd Check that the types in RPITITs are WF 2022-09-11 06:58:11 +00:00
bors
98f3001eec Auto merge of #101527 - Kobzol:ci-update-llvm, r=Mark-Simulacrum
Update LLVM used in x86 CI dist builds to `15.0.0`

LLVM 15.0.0 has been released, so we can use it in CI builds. We need (at least) LLVM 15 for BOLT, and we regularly update to most recent stable versions. It would also be good to first see the perf. effect of upgrading by itself, to have a better baseline for BOLT.

r? `@Mark-Simulacrum`
2022-09-09 09:05:59 +00:00
bors
4a09adf99f Auto merge of #101603 - matthiaskrgr:rollup-8y6kf20, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #99207 (Enable eager checks for memory sanitizer)
 - #101253 (fix the suggestion of format for asm_sub_register)
 - #101450 (Add `const_extern_fn` to 1.62 release notes.)
 - #101556 (Tweak future opaque ty pretty printing)
 - #101563 (Link UEFI target documentation from target list)
 - #101593 (Cleanup themes (tooltip))

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-09 06:24:25 +00:00
Matthias Krüger
8b78fa055e
Rollup merge of #101593 - GuillaumeGomez:cleanup-theme-tooltip, r=notriddle
Cleanup themes (tooltip)

No changes in the UI. I used this opportunity to unify the dark theme with the others for the alpha parameter though.

r? `@notriddle`
2022-09-09 07:02:34 +02:00
Matthias Krüger
1a61afda14
Rollup merge of #101563 - sanxiyn:doc-link-uefi, r=ehuss
Link UEFI target documentation from target list

#99760 added UEFI target documentation, but forgot to link it from the main target list.
2022-09-09 07:02:33 +02:00
Matthias Krüger
bdfbc3597b
Rollup merge of #101556 - compiler-errors:tweak-generator-print, r=jackh726
Tweak future opaque ty pretty printing

1. The `Return` type of a generator doesn't need to be a lang item just for diagnostic printing of types
2. We shouldn't suppress the `Output = Ty` of a opaque future if the type is a int or float var.
2022-09-09 07:02:32 +02:00
Matthias Krüger
434591cd13
Rollup merge of #101450 - ehuss:relnotes-95346, r=Mark-Simulacrum
Add `const_extern_fn` to 1.62 release notes.

Adds #95346 which did not get tagged with relnotes.

Closes #101443
2022-09-09 07:02:31 +02:00
Matthias Krüger
0354eee4c6
Rollup merge of #101253 - lyming2007:issue-101163, r=Amanieu
fix the suggestion of format for asm_sub_register

	modified:   compiler/rustc_typeck/src/check/intrinsicck.rs
	modified:   src/test/ui/asm/bad-template.aarch64_mirunsafeck.stderr
	modified:   src/test/ui/asm/bad-template.aarch64_thirunsafeck.stderr
	modified:   src/test/ui/asm/bad-template.x86_64_mirunsafeck.stderr
	modified:   src/test/ui/asm/bad-template.x86_64_thirunsafeck.stderr
	modified:   src/test/ui/asm/type-check-1.rs
	modified:   src/test/ui/asm/type-check-1.stderr
	modified:   src/test/ui/asm/x86_64/type-check-3.stderr
2022-09-09 07:02:30 +02:00
Matthias Krüger
6d2033512b
Rollup merge of #99207 - 5225225:msan-eager-checks, r=jackh726
Enable eager checks for memory sanitizer

Fixes #99179
2022-09-09 07:02:30 +02:00
bors
ab32548539 Auto merge of #101224 - compiler-errors:rpitit, r=oli-obk
Initial implementation of return-position `impl Trait` in traits

* Create a new item kind, called `ImplTraitPlaceholder`, which is used to lower `ast::TyKind::ImplTrait` in trait method returns.
    * This item is the child of the trait method, which simplifies the way we calculate bounds and stuff.
* Use the def-id of this type to construct a projection type that we use during astconv for the return type of the trait method signature.
* Implement logic to normalize this `ImplTraitPlaceholder` projection type when we know its concrete impl (this is pretty limited currently, but really there are no other selection candidates that make sense -- for now!)
* Check that the `impl Trait`'s bounds are satisfied on the concrete type provided in the impl.

This is obviously nowhere near complete, but I wanted to at least get some initial support landed so we can start playing around with it.

What works:
* async fn in trait and RPITIT, including multiple `impl Trait`s and `impl Trait` nested in associated type bindings, like `impl Future<Output = impl Sized>`
2022-09-09 03:40:17 +00:00
Michael Goulet
6876c94d80 Fix documentation lint failures 2022-09-09 01:31:46 +00:00
Michael Goulet
270b776ef9 Adjust pretty printing of RPITITs 2022-09-09 01:31:46 +00:00
Michael Goulet
ec170bef0d Rebase fallout 2022-09-09 01:31:46 +00:00
Michael Goulet
526511e86b Appease clippy again 2022-09-09 01:31:46 +00:00
Michael Goulet
55df9201fe Tweak feature error, add test 2022-09-09 01:31:46 +00:00
Camille GILLOT
05812df603 Handle generic parameters. 2022-09-09 01:31:46 +00:00
Michael Goulet
cdf78073c5 Deeply check that method signatures match, and allow for nested RPITITs 2022-09-09 01:31:46 +00:00
Michael Goulet
1f03edeabe Bless tests, fix ICE with ImplTraitPlaceholder 2022-09-09 01:31:45 +00:00
Michael Goulet
70775304cd Address nits 2022-09-09 01:31:45 +00:00
Michael Goulet
249ede4195 Address rebase issues, make async fn in trait work 2022-09-09 01:31:45 +00:00
Michael Goulet
5be30f9d79 Make async fn in traits work 2022-09-09 01:31:45 +00:00
Michael Goulet
ed2a32f22c Make clippy happy 2022-09-09 01:31:45 +00:00
Michael Goulet
81badff860 Add tests 2022-09-09 01:31:45 +00:00
Michael Goulet
e8fa74ae45 Check that impl types actually satisfy RPITIT bounds 2022-09-09 01:31:45 +00:00
Michael Goulet
a4d1807d6d Rustdoc support 2022-09-09 01:31:45 +00:00
Michael Goulet
4265ef8cb2 Implement projection for ImplTraitPlaceholder 2022-09-09 01:31:44 +00:00
Michael Goulet
d34cb98fb0 Lower RPITIT to ImplTraitPlaceholder item 2022-09-09 01:31:44 +00:00
Michael Goulet
78b962a4f3 RPITIT placeholder items 2022-09-09 01:31:44 +00:00
bors
7200da0217 Auto merge of #93873 - Stovent:big-ints, r=m-ou-se
Reimplement `carrying_add` and `borrowing_sub` for signed integers.

As per the discussion in #85532, this PR reimplements `carrying_add` and `borrowing_sub` for signed integers.

It also adds unit tests for both unsigned and signed integers, emphasing on the behaviours of the methods.
2022-09-09 00:59:08 +00:00
Guillaume Gomez
f9da510cff Add gui test for codeblocks tooltip colors 2022-09-09 00:11:16 +02:00
Guillaume Gomez
01fc131342 Clean up themes a bit more 2022-09-09 00:11:16 +02:00
bors
c6861df836 Auto merge of #101592 - compiler-errors:rollup-d2fya7z, r=compiler-errors
Rollup of 7 pull requests

Successful merges:

 - #101423 (Fix hermit warnings)
 - #101499 (Introduce lowering_arena to avoid creating AST nodes on the fly)
 - #101530 (llvm-wrapper: adapt for LLVM API changes)
 - #101554 (rustdoc: remove unused CSS `#implementations-list > h3 > span.in-band`)
 - #101580 (rustdoc: remove unused CSS `div.impl-items > div`)
 - #101584 (rustdoc: remove no-op CSS `#settings-menu { padding: 0 }`)
 - #101587 (Make `Debug` impl for `Term` useful)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-08 21:45:23 +00:00
Michael Goulet
e43cf3deeb
Rollup merge of #101587 - BoxyUwU:term_debug, r=compiler-errors
Make `Debug` impl for `Term` useful

because `Term { ptr: 78942378998734298342, maker: PhantomData, }` does not excel at communicating the necessary information
2022-09-08 14:41:13 -07:00
Michael Goulet
7300e4db2d
Rollup merge of #101584 - notriddle:notriddle/settings-menu, r=GuillaumeGomez
rustdoc: remove no-op CSS `#settings-menu { padding: 0 }`

This CSS was added in 5e01ba36c9, and served to override CSS right above it that set a 5px padding for several kinds of buttons in the same toolbar:

5e01ba36c9/src/librustdoc/html/static/css/rustdoc.css (L1400-L1409)

The CSS that it overrode is still there, but now it only applies to `#settings-menu > a`, so there's nothing to override.

24d6992020/src/librustdoc/html/static/css/rustdoc.css (L1445-L1454)
2022-09-08 14:41:12 -07:00
Michael Goulet
b3001230a5
Rollup merge of #101580 - notriddle:notriddle/div-impl-items-div, r=GuillaumeGomez
rustdoc: remove unused CSS `div.impl-items > div`

This was added in 9077d540da to override the style on `<div>` tags that were acting as headers. These `<div>` tags were replaced with `<section>` tags in 32f62607c3, but this CSS was probably already redundant even then (the headers had already been replaced with real `<h3>` and `<h4>` tags in 76a3b609d0).
2022-09-08 14:41:11 -07:00
Michael Goulet
c810cd19b2
Rollup merge of #101554 - notriddle:notriddle/implemenation-list-h3-span-in-band, r=Dylan-DPC
rustdoc: remove unused CSS `#implementations-list > h3 > span.in-band`

This was added in 51f26acaea to help with the display of an `<h3>` tag that has a `<span class='in-band'>` inside.

The way implementation lists were rendered was changed in 34bd2b845b to have `<code class='in-band'>`, making this CSS unused.

Then it was turned into a `<div>` in 9077d540da without issue.

Finally, the header itself acquired the `in-band` class in 76a3b609d0.
2022-09-08 14:41:10 -07:00
Michael Goulet
963a9ecb85
Rollup merge of #101530 - krasimirgg:llvm-16-up, r=cuviper
llvm-wrapper: adapt for LLVM API changes

No functional changes intended.

Adapts PassWrapper for a few recent LLVM API changes:
* e7bac3b9fa
* 93600eb50c
* 5e38b2a456

Note that `ModuleMemorySanitizerPass` was renamed back to its pre-14 name, `MemorySanitizerPass`, hence the funky `#if LLVM_VERSION_GE(14, 0) && LLVM_VERSION_LT(16, 0)` guard.

Found via our experimental rust + llvm at HEAD bot: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/13290#018315e6-24e1-44c8-b56d-9aad9be11c29
2022-09-08 14:41:09 -07:00
Michael Goulet
1499c089df
Rollup merge of #101499 - spastorino:add-lowering-arena, r=oli-obk
Introduce lowering_arena to avoid creating AST nodes on the fly

`@oli-obk` requested this and other changes as a way of simplifying https://github.com/rust-lang/rust/pull/101345. This is just going to make the diff of https://github.com/rust-lang/rust/pull/101345 smaller.

r? `@oli-obk` `@cjgillot`
2022-09-08 14:41:08 -07:00
Michael Goulet
2c4dc4f494
Rollup merge of #101423 - mkroening:hermit-warnings, r=sanxiyn
Fix hermit warnings

This fixes two `unused_imprt` and one `dead_code` warning for hermit.
2022-09-08 14:41:08 -07:00
Ellen
ef36af2f9d ptr: 43276834268743978 2022-09-08 21:09:23 +01:00
bors
1120c5e01d Auto merge of #101437 - compiler-errors:erase-normalize-ordering, r=tmandry
Normalize before erasing late-bound regions in `equal_up_to_regions`

Normalize erasing regions **first**, before passing the type through a `BottomUpFolder` which erases late-bound regions too.

The root cause of this issue is due to 96d4137dee, which removes a `normalize_erasing_regions` that happens before this call to `equal_up_to_regions`. While reverting that commit might be a fix, I think it was suspicious to be erasing late-bound regions first _then_ normalizing types in the first place in `equal_up_to_regions`.

-----

I am tempted to ask the reviewer to review and `r+` this without a UI test, since the existing issues that I think this fixes are all incredibly difficult to minimize (anything hyper/warp related, given the nature of those libraries 😓) or impossible to reproduce locally (the miri test), namely:
* This recently reported issue with tokio + warp: #101430
* This issue from `@RalfJung` about Miri being broken: #101344
* This additional issue reported in a comment by `@tmandry` (issue with fuchsia + hyper): https://github.com/rust-lang/rust/issues/101344#issuecomment-1235974564

I have locally verified that the repro in #101430 is fixed with this PR, but after a couple of hours of attempting to minimize this error and either failing to actually repro the ICE, or being overwhelmed with the number of traits and functions I need to inline into a UI test, I have basically given up. Thoughts are appreciated on how best to handle this.

r? `@oli-obk` who is at the intersection of MIR and types-related stuff who may be able to give advice 😅
2022-09-08 19:01:39 +00:00
Michael Howell
b9093f4008 rustdoc: remove no-op CSS #settings-menu { padding: 0 }
This CSS was added in 5e01ba36c9, and served to
override CSS right above it that set a 5px padding for several kinds of
buttons in the same toolbar.

The CSS that it overrode is still there, but now it only applies to
`#settings-menu > a`, so there's nothing to override.
2022-09-08 10:34:57 -07:00
Santiago Pastorino
d9a1faaa9c
Introduce lowering_arena to avoid creating AST nodes on the fly 2022-09-08 13:34:55 -03:00
bors
87788097b7 Auto merge of #101577 - Dylan-DPC:rollup-l9xw7i7, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #98933 (Opaque types' generic params do not imply anything about their hidden type's lifetimes)
 - #101041 (translations(rustc_session): migrates rustc_session to use SessionDiagnostic - Pt. 2)
 - #101424 (Adjust and slightly generalize operator error suggestion)
 - #101496 (Allow lower_lifetime_binder receive a closure)
 - #101501 (Allow lint passes to be bound by `TyCtxt`)
 - #101515 (Recover from typo where == is used in place of =)
 - #101545 (Remove unnecessary `PartialOrd` and `Ord`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-08 15:53:14 +00:00
Michael Howell
f7b10b96cb rustdoc: remove unused CSS div.impl-items > div
This was added in 9077d540da to override the
style on `<div>` tags that were acting as headers. These `<div>` tags were
replaced with `<section>` tags in 32f62607c3,
but this CSS was probably already redundant even then (the headers had
already been replaced with real `<h3>` and `<h4>` tags in
76a3b609d0).
2022-09-08 08:51:18 -07:00
Dylan DPC
720a82dd52
Rollup merge of #101545 - TaKO8Ki:remove-unnecessary-partialord-ord, r=oli-obk
Remove unnecessary `PartialOrd` and `Ord`
2022-09-08 20:48:38 +05:30
Dylan DPC
8d2a492d73
Rollup merge of #101515 - chenyukang:fix-101477, r=fee1-dead
Recover from typo where == is used in place of =

Fixes #101477
2022-09-08 20:48:37 +05:30
Dylan DPC
2904060314
Rollup merge of #101501 - Jarcho:tcx_lint_passes, r=davidtwco
Allow lint passes to be bound by `TyCtxt`

This will allow storing things like `Ty<'tcx>` inside late lint passes. It's already possible to store various id types so they're already implicitly bound to a specific `TyCtxt`.

r? rust-lang/compiler
2022-09-08 20:48:36 +05:30
Dylan DPC
953a6b3da7
Rollup merge of #101496 - spastorino:lower_lifetime_binder_api_changes, r=oli-obk
Allow lower_lifetime_binder receive a closure

``@oli-obk`` requested this and other changes as a way of simplifying https://github.com/rust-lang/rust/pull/101345. This is just going to make the diff of https://github.com/rust-lang/rust/pull/101345 smaller.

r? ``@oli-obk`` ``@cjgillot``
2022-09-08 20:48:36 +05:30
Dylan DPC
b5ffbd32d4
Rollup merge of #101424 - compiler-errors:operator-err-sugg, r=TaKO8Ki
Adjust and slightly generalize operator error suggestion

(in no particular order)
* Stop passing around a whole extra `ProjectionPredicate`
* Add spaces around `=` in `Trait<..., Output = Ty>` suggestion
* Some code clean-ups, including
    * add `lang_item_for_op` to turn a `Op` into a `DefId`
    * avoid `SourceMap` because we don't really need to render an expr
    * Remove `TypeParamVisitor` in favor of just checking `ty.has_param_types_or_consts` -- this acts a bit differently, but shouldn't cause erroneous suggestions (actually might generalize them a bit)
* We now suggest `Output = Ty` in the `where` clause suggestion when we fail to add `Struct<T>` and `T`.

I can split this out into more PRs if needed, but they're all just miscellaneous generalizations, changes, and nitpicks I saw when messing with this operator code.
2022-09-08 20:48:34 +05:30