]> git.lizzy.rs Git - rust.git/log
rust.git
19 months agoBump version placeholders to release
Mark Rousskov [Mon, 31 Oct 2022 14:43:15 +0000 (10:43 -0400)]
Bump version placeholders to release

19 months agoAuto merge of #99943 - compiler-errors:tuple-trait, r=jackh726
bors [Sun, 6 Nov 2022 17:48:33 +0000 (17:48 +0000)]
Auto merge of #99943 - compiler-errors:tuple-trait, r=jackh726

Implement `std::marker::Tuple`, use it in `extern "rust-call"` and `Fn`-family traits

Implements rust-lang/compiler-team#537

I made a few opinionated decisions in this implementation, specifically:
1. Enforcing `extern "rust-call"` on fn items during wfcheck,
2. Enforcing this for all functions (not just ones that have bodies),
3. Gating this `Tuple` marker trait behind its own feature, instead of grouping it into (e.g.) `unboxed_closures`.

Still needing to be done:
1. Enforce that `extern "rust-call"` `fn`-ptrs are well-formed only if they have 1/2 args and the second one implements `Tuple`. (Doing this would fix ICE in #66696.)
2. Deny all explicit/user `impl`s of the `Tuple` trait, kinda like `Sized`.
3. Fixing `Tuple` trait built-in impl for chalk, so that chalkification tests are un-broken.

Open questions:
1. Does this need t-lang or t-libs signoff?

Fixes #99820

19 months agoAuto merge of #103861 - compiler-errors:codegen-select-in-vtable-slot, r=nagisa
bors [Sun, 6 Nov 2022 14:03:59 +0000 (14:03 +0000)]
Auto merge of #103861 - compiler-errors:codegen-select-in-vtable-slot, r=nagisa

Use `codegen_select` in `vtable_trait_upcasting_coercion_new_vptr_slot`

A super tiny clean up

19 months agoAuto merge of #103720 - crlf0710:most_translation_attr, r=compiler-errors
bors [Sun, 6 Nov 2022 11:23:24 +0000 (11:23 +0000)]
Auto merge of #103720 - crlf0710:most_translation_attr, r=compiler-errors

Lint against usages of `struct_span_lint_hir`.

r? `@compiler-errors`

19 months agoAuto merge of #104043 - matthiaskrgr:rollup-sttf9e8, r=matthiaskrgr
bors [Sun, 6 Nov 2022 08:13:56 +0000 (08:13 +0000)]
Auto merge of #104043 - matthiaskrgr:rollup-sttf9e8, r=matthiaskrgr

Rollup of 7 pull requests

Successful merges:

 - #103012 (Suggest use .. to fill in the rest of the fields of Struct)
 - #103851 (Fix json flag in bootstrap doc)
 - #103990 (rustdoc: clean up `.logo-container` layout CSS)
 - #104002 (fix a comment in UnsafeCell::new)
 - #104014 (Migrate test-arrow to CSS variables)
 - #104016 (Add internal descriptions to a few queries)
 - #104035 (Add 'closure match' test to weird-exprs.rs.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

19 months agoRollup merge of #104035 - m-ou-se:weird-expr-closure-match, r=compiler-errors
Matthias Krüger [Sun, 6 Nov 2022 07:35:28 +0000 (08:35 +0100)]
Rollup merge of #104035 - m-ou-se:weird-expr-closure-match, r=compiler-errors

Add 'closure match' test to weird-exprs.rs.

Having fun with patterns that look like closures.

19 months agoRollup merge of #104016 - Nilstrieb:query-descs-more, r=compiler-errors
Matthias Krüger [Sun, 6 Nov 2022 07:35:28 +0000 (08:35 +0100)]
Rollup merge of #104016 - Nilstrieb:query-descs-more, r=compiler-errors

Add internal descriptions to a few queries

helps with #104008

19 months agoRollup merge of #104014 - GuillaumeGomez:run-button-css-var, r=notriddle
Matthias Krüger [Sun, 6 Nov 2022 07:35:27 +0000 (08:35 +0100)]
Rollup merge of #104014 - GuillaumeGomez:run-button-css-var, r=notriddle

Migrate test-arrow to CSS variables

There should be no UI changes. I kept both `color` and `background-color` properties even though only the ayu theme is actually completely making use of them on hover.

r? ``@notriddle``

19 months agoRollup merge of #104002 - RalfJung:unsafecell-new, r=JohnTitor
Matthias Krüger [Sun, 6 Nov 2022 07:35:27 +0000 (08:35 +0100)]
Rollup merge of #104002 - RalfJung:unsafecell-new, r=JohnTitor

fix a comment in UnsafeCell::new

There are several safe methods that access the inner value: `into_inner` has existed since forever and `get_mut` also exists since recently. So this comment seems just wrong. But `&self` methods return raw pointers and thus require unsafe code (though the methods themselves are still safe).

19 months agoRollup merge of #103990 - notriddle:notriddle/logo-container, r=GuillaumeGomez
Matthias Krüger [Sun, 6 Nov 2022 07:35:26 +0000 (08:35 +0100)]
Rollup merge of #103990 - notriddle:notriddle/logo-container, r=GuillaumeGomez

rustdoc: clean up `.logo-container` layout CSS

This commit should result in no appearance changes.

To make the logo container exactly the desired height, you want to get rid of the part of the box used for typographic descenders (you know, the part of g, y, and j that descends below the baseline). After all, it contains no text, but the space is still left open in the layout by default, because `<img>` is `display:inline`. The CSS used to employ three different tricks to accomplish this:

* By making `.sidebar .logo-container` a flex container, the image becomes a flex item and is [blockified], without synthesizing any inline boxes. No inline boxes means no descenders.
* By giving `.mobile-topbar .logo-container` a max-height exactly the same as the height of the image plus the padding, the descender area gets cut off.
* By setting `.sub-logo-container { line-height: 0 }`, we ensure that the only box that contributes to the height of the line box is the image itself, and not any zero-content text boxes that neighbor it. See the [logical height algorithm].

This commit gets rid of the first two hacks, leaving only the third, since it requires only one line of code to accomplish and doesn't require setting the value based on math.

[blockified]: https://drafts.csswg.org/css-flexbox-1/#flex-items
[logical height algorithm]: https://www.w3.org/TR/css-inline-3/#inline-height

19 months agoRollup merge of #103851 - viandoxdev:103816_bootstrap_fix_json_doc, r=jyn514
Matthias Krüger [Sun, 6 Nov 2022 07:35:26 +0000 (08:35 +0100)]
Rollup merge of #103851 - viandoxdev:103816_bootstrap_fix_json_doc, r=jyn514

Fix json flag in bootstrap doc

Fix the `--json` flag not working with x.py (Closes #103816)

While this works I'm not sure about the `should_run` of `JsonStd`, had to change it because https://github.com/rust-lang/rust/blob/ab5a2bc7316012ee9b2a4a4f3821673f2677f3d5/src/bootstrap/builder.rs#L334 would match with JsonStd and remove the paths that Std matched. So I did [this](https://github.com/viandoxdev/rust/blob/ffd4078264c4892b5098d6191e0adfe3564d62ca/src/bootstrap/doc.rs#L526-L534) but that looks more like a hack/workaround than anything. I'm guessing there's something to do with the default condition thing but idk how it works

19 months agoRollup merge of #103012 - chenyukang:fix-102806, r=davidtwco,compiler-errors
Matthias Krüger [Sun, 6 Nov 2022 07:35:26 +0000 (08:35 +0100)]
Rollup merge of #103012 - chenyukang:fix-102806, r=davidtwco,compiler-errors

Suggest use .. to fill in the rest of the fields of Struct

Fixes #102806

19 months agoAuto merge of #102618 - aliemjay:simplify-closure-promote, r=compiler-errors
bors [Sun, 6 Nov 2022 05:26:09 +0000 (05:26 +0000)]
Auto merge of #102618 - aliemjay:simplify-closure-promote, r=compiler-errors

rework applying closure requirements in borrowck

Previously the promoted closure constraints were registered under the category `ConstraintCategory::ClosureBounds` in `type_check::prove_closure_bounds()` and then mapped back their original category in `regions_infer::best_blame_constraint` using the complicated map `closure_bounds_mapping`.

Now we're registering promoted constraints under their original category and span earlier in `type_check::prove_closure_bounds`.

See commit messages.

Fixes #99245

19 months agoFix typo
Michael Goulet [Sun, 6 Nov 2022 02:33:12 +0000 (19:33 -0700)]
Fix typo

19 months agoAuto merge of #103975 - oli-obk:tracing, r=jackh726
bors [Sun, 6 Nov 2022 02:21:34 +0000 (02:21 +0000)]
Auto merge of #103975 - oli-obk:tracing, r=jackh726

Some tracing and comment cleanups

Pulled out of https://github.com/rust-lang/rust/pull/101900 to see if that is the perf impact

19 months agoAdd more nonsense to weird-exprs.rs.
Mara Bos [Sun, 6 Nov 2022 00:22:31 +0000 (01:22 +0100)]
Add more nonsense to weird-exprs.rs.

19 months agoAuto merge of #104009 - Nilstrieb:query-unify-config-desc, r=jyn514
bors [Sat, 5 Nov 2022 23:21:01 +0000 (23:21 +0000)]
Auto merge of #104009 - Nilstrieb:query-unify-config-desc, r=jyn514

Merge `QueryDescription` into `QueryConfig`

`QueryDescription` has gone through a lot of refactoring and doesn't make sense anymore.

r? `@jyn514`

19 months agorustdoc: add test case for huge logo
Michael Howell [Sat, 5 Nov 2022 17:14:31 +0000 (10:14 -0700)]
rustdoc: add test case for huge logo

19 months agoAuto merge of #102458 - JohnTitor:stabilize-instruction-set, r=oli-obk
bors [Sat, 5 Nov 2022 20:39:06 +0000 (20:39 +0000)]
Auto merge of #102458 - JohnTitor:stabilize-instruction-set, r=oli-obk

Stabilize the `instruction_set` feature

Closes https://github.com/rust-lang/rust/issues/74727
FCP is complete on https://github.com/rust-lang/rust/issues/74727#issuecomment-1242773253
r? `@pnkfelix` and/or `@nikomatsakis`
cc `@xd009642`

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
19 months agoBless more tests
Michael Goulet [Sun, 2 Oct 2022 19:41:54 +0000 (19:41 +0000)]
Bless more tests

19 months agoMerge conflicts and rebase onto master
Michael Goulet [Sun, 2 Oct 2022 06:57:01 +0000 (06:57 +0000)]
Merge conflicts and rebase onto master

19 months agoBless chalk tests
Michael Goulet [Sat, 30 Jul 2022 05:43:26 +0000 (05:43 +0000)]
Bless chalk tests

19 months agoAdjust diagnostics, bless tests
Michael Goulet [Sat, 30 Jul 2022 05:37:48 +0000 (05:37 +0000)]
Adjust diagnostics, bless tests

19 months agoEnforce rust-check ABI in signatures, calls
Michael Goulet [Sat, 30 Jul 2022 03:41:53 +0000 (03:41 +0000)]
Enforce rust-check ABI in signatures, calls

19 months agoAuto merge of #104017 - matthiaskrgr:rollup-k8i0j9m, r=matthiaskrgr
bors [Sat, 5 Nov 2022 17:39:16 +0000 (17:39 +0000)]
Auto merge of #104017 - matthiaskrgr:rollup-k8i0j9m, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #101702 (rustdoc: add hash to filename of toolchain files)
 - #103920 (Move browser opening logic in `Builder`)
 - #103927 (Do not make typo suggestions when suggesting pattern matching)
 - #103972 (Remove an option and choose a behaviour-preserving default instead.)
 - #103988 (Fix search result bottom border color)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

19 months agoEnforce Tuple trait on Fn traits
Michael Goulet [Sat, 30 Jul 2022 01:53:53 +0000 (01:53 +0000)]
Enforce Tuple trait on Fn traits

19 months agofix out dir being wrong in json
viandoxdev [Sat, 5 Nov 2022 17:30:01 +0000 (18:30 +0100)]
fix out dir being wrong in json

19 months agoRollup merge of #103988 - GuillaumeGomez:fix-bottom-border-color, r=notriddle
Matthias Krüger [Sat, 5 Nov 2022 17:06:07 +0000 (18:06 +0100)]
Rollup merge of #103988 - GuillaumeGomez:fix-bottom-border-color, r=notriddle

Fix search result bottom border color

It reverts a color change while keeping the improvement made in #103938.

I think it'll need to be backported once merged too.

r? `@notriddle`

19 months agoRollup merge of #103972 - oli-obk:unoptional, r=fee1-dead
Matthias Krüger [Sat, 5 Nov 2022 17:06:07 +0000 (18:06 +0100)]
Rollup merge of #103972 - oli-obk:unoptional, r=fee1-dead

Remove an option and choose a behaviour-preserving default instead.

r? ``@fee1-dead``

19 months agoRollup merge of #103927 - fee1-dead-contrib:E0425-no-typo-when-pattern-matching,...
Matthias Krüger [Sat, 5 Nov 2022 17:06:06 +0000 (18:06 +0100)]
Rollup merge of #103927 - fee1-dead-contrib:E0425-no-typo-when-pattern-matching, r=cjgillot

Do not make typo suggestions when suggesting pattern matching

Fixes #103909.

19 months agoRollup merge of #103920 - ferrocene:pa-maybe-open-in-browser, r=jyn514
Matthias Krüger [Sat, 5 Nov 2022 17:06:06 +0000 (18:06 +0100)]
Rollup merge of #103920 - ferrocene:pa-maybe-open-in-browser, r=jyn514

Move browser opening logic in `Builder`

This allows `open()` to be called from other places in bootstrap (I need this for Ferrocene, as we keep our custom steps in `src/bootstrap/ferrocene`), and it simplifies the callers by moving the `was_invoked_explicitly` check into the function.

19 months agoRollup merge of #101702 - jsha:static-files2, r=notriddle,GuillaumeGomez
Matthias Krüger [Sat, 5 Nov 2022 17:06:05 +0000 (18:06 +0100)]
Rollup merge of #101702 - jsha:static-files2, r=notriddle,GuillaumeGomez

rustdoc: add hash to filename of toolchain files

All static files used by rustdoc are now stored in static.files/ and their filenames include a hash of their contents. Their filenames no longer include the contents of the --resource-suffix flag. This clarifies caching semantics. Anything in static.files can use Cache-Control: immutable because any updates will show up as a new URL.

Invocation-specific files like crates-NN.js, search-index-NN.js, and sidebar-items-NN.js still get the resource suffix.

This has a useful side effect: once toolchain files aren't affected by resource suffix, it will become possible for docs.rs to include crate version in the resource suffix. That should fix a caching issue with `/latest/` URLs: https://github.com/rust-lang/docs.rs/issues/1593. My goal is that it should be safe to serve all rustdoc JS, CSS, and fonts with infinite caching headers, even when new versions of a crate are uploaded in the same place as old versions.

The --disable-minification flag is removed because it would vary the output of static files based on invocation flags. Instead, for rustdoc development purposes it's preferable to symlink static files to a non-minified copy for quick iteration.

Example listing:

```
$ cd build/x86_64-unknown-linux-gnu/doc/ && find . | egrep 'js$|css$' | egrep -v 'sidebar-items|implementors' | sort
./crates1.65.0.js
./rust.css
./search-index1.65.0.js
./source-files1.65.0.js
./static.files/ayu-2bfd0af01c176fd5.css
./static.files/dark-95d11b5416841799.css
./static.files/light-c83a97e93a11f15a.css
./static.files/main-efc63f77fb116394.js
./static.files/normalize-76eba96aa4d2e634.css
./static.files/noscript-5bf457055038775c.css
./static.files/rustdoc-7a422337900fa894.css
./static.files/scrape-examples-3dd10048bcead3a4.js
./static.files/search-47f3c289722672cf.js
./static.files/settings-17b08337296ac774.js
./static.files/settings-3f95eacb845293c0.css
./static.files/source-script-215e9db86679192e.js
./static.files/storage-26d846fcae82ff09.js
```

Fixes #98413

19 months agoAdd internal descriptions to a few queries
Nilstrieb [Sat, 5 Nov 2022 16:54:15 +0000 (17:54 +0100)]
Add internal descriptions to a few queries

19 months agoSimplify code
Nilstrieb [Sat, 5 Nov 2022 16:54:06 +0000 (17:54 +0100)]
Simplify code

19 months agoExtend GUI test for run button
Guillaume Gomez [Sat, 5 Nov 2022 16:22:38 +0000 (17:22 +0100)]
Extend GUI test for run button

19 months agoMigrate test-arrow to CSS variables
Guillaume Gomez [Sat, 5 Nov 2022 16:22:25 +0000 (17:22 +0100)]
Migrate test-arrow to CSS variables

19 months agoUpdate GUI test for bottom border color
Guillaume Gomez [Fri, 4 Nov 2022 21:36:14 +0000 (22:36 +0100)]
Update GUI test for bottom border color

19 months agoFix search result bottom border color
Guillaume Gomez [Fri, 4 Nov 2022 21:36:04 +0000 (22:36 +0100)]
Fix search result bottom border color

19 months agoDo not make typo suggestions when suggesting pattern matching
Deadbeef [Thu, 3 Nov 2022 14:35:15 +0000 (14:35 +0000)]
Do not make typo suggestions when suggesting pattern matching

Fixes #103909.

19 months agoMerge `QueryDescription` into `QueryConfig`
Nilstrieb [Sat, 5 Nov 2022 15:04:43 +0000 (16:04 +0100)]
Merge `QueryDescription` into `QueryConfig`

`QueryDescription` has gone through a lot of refactoring and doesn't
make sense anymore.

19 months agoAuto merge of #103831 - chenyukang:yukang/fix-103751-ice, r=nagisa
bors [Sat, 5 Nov 2022 13:48:30 +0000 (13:48 +0000)]
Auto merge of #103831 - chenyukang:yukang/fix-103751-ice, r=nagisa

Fix capacity overflow issue during transmutability check

Fixes #103751

19 months agofix a comment in UnsafeCell::new
Ralf Jung [Sat, 5 Nov 2022 11:25:58 +0000 (12:25 +0100)]
fix a comment in UnsafeCell::new

19 months agoAuto merge of #103691 - michaelwoerister:consistent-slice-and-str-cpp-like-debuginfo...
bors [Sat, 5 Nov 2022 11:07:50 +0000 (11:07 +0000)]
Auto merge of #103691 - michaelwoerister:consistent-slice-and-str-cpp-like-debuginfo-names, r=wesleywiser

[debuginfo] Make cpp-like debuginfo type names for slices and str consistent.

Before this PR, the compiler would emit the debuginfo name `slice$<T>` for all kinds of slices, regardless of whether they are behind a reference or not and regardless of the kind of reference. As a consequence, the types `Foo<&[T]>`, `Foo<[T]>`, and `Foo<&mut [T]>` would end up with the same type name `Foo<slice$<T> >` in debuginfo, making it impossible to disambiguate between them by name. Similarly, `&str` would get the name `str` in debuginfo, so the debuginfo name for `Foo<str>` and `Foo<&str>` would be the same. In contrast, `*const [bool]` and `*mut [bool]` would be `ptr_const$<slice$<bool> >` and `ptr_mut$<slice$<bool> >`, i.e. the encoding does not lose information about the type.

This PR removes all special handling for slices and `str`. The types `&[bool]`, `&mut [bool]`, and `&str` thus get the names `ref$<slice2$<bool> >`, `ref_mut$<slice2$<bool> >`, and `ref$<str$>` respectively -- as one would expect.

The new special name for slices is `slice2$` to differentiate it from the previous name `slice$`, which has different semantics. The same is true for `str` and `str$`. This kind of versioning already has a precedent with the case of `enum$` and `enum2$` and hopefully will make it easier to transition existing consumers of these names.

cc `@rust-lang/wg-debugging` `@vadimcn`

r? `@wesleywiser`

UPDATE: Here is a table to clarify the changes

| Rust type | DWARF name | C++-like name (before) | C++-like name (after) |
|-----------|------------|------------------------|------------------------|
| `[T]`        | `[T]`        | `slice$<T>`              | `slice2$<T>`           |
| `&[T]`       | `&[T]`       | `slice$<T>`              | `ref$<slice2$<T> >`    |
| `&mut [T]`   | `&mut [T]`   | `slice$<T>`              | `ref_mut$<slice2$<T> >`|
| `str`        | `str`        | `str`                    | `str$`           |
| `&str`       | `&str`       | `str`                    | `ref$<str$>`    |
| `&mut str`   | `&mut str`   | `str`                    | `ref_mut$<str$>`|
| `*const [T]` | `*const [T]` | `ptr_const$<slice$<T> >` | `ptr_const$<slice2$<T> >` |
| `*mut [T]`   | `*mut [T]`   | `ptr_mut$<slice$<T> >`   | `ptr_mut$<slice2$<T> >` |

As you can see, before the PR many types would end up with the same name, making it impossible to distinguish between them in NatVis or other places where types are matched or looked up by name. The DWARF version of names is not changed.

19 months agoAuto merge of #103998 - Dylan-DPC:rollup-2nbmtc9, r=Dylan-DPC
bors [Sat, 5 Nov 2022 07:32:09 +0000 (07:32 +0000)]
Auto merge of #103998 - Dylan-DPC:rollup-2nbmtc9, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #103621 (Correctly resolve Inherent Associated Types)
 - #103660 (improve `filesearch::get_or_default_sysroot`)
 - #103866 (Remove some return-type diagnostic booleans from `FnCtxt`)
 - #103867 (Remove `has_errors` from `FnCtxt`)
 - #103994 (Specify that `break` cannot be used outside of loop *or* labeled block)
 - #103995 (Small round of typo fixes)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

19 months agoRollup merge of #103995 - SUPERCILEX:typos, r=Dylan-DPC
Dylan DPC [Sat, 5 Nov 2022 06:01:30 +0000 (11:31 +0530)]
Rollup merge of #103995 - SUPERCILEX:typos, r=Dylan-DPC

Small round of typo fixes

19 months agoRollup merge of #103994 - clubby789:break-unlabeled, r=TaKO8Ki
Dylan DPC [Sat, 5 Nov 2022 06:01:30 +0000 (11:31 +0530)]
Rollup merge of #103994 - clubby789:break-unlabeled, r=TaKO8Ki

Specify that `break` cannot be used outside of loop *or* labeled block

Closes #103981

`@rustbot` label +A-diagnostics

19 months agoRollup merge of #103867 - compiler-errors:no-has-errors, r=cjgillot
Dylan DPC [Sat, 5 Nov 2022 06:01:29 +0000 (11:31 +0530)]
Rollup merge of #103867 - compiler-errors:no-has-errors, r=cjgillot

Remove `has_errors` from `FnCtxt`

It doesn't seem like this `has_errors` flag actually suppresses any errors (at least in the UI test suite) --- except for one test (`E0767.rs`), and I think that error really should be considered legitimate, since it has nothing to do with the error code and continues to exist after you fix the first error...

This flag was added by ```@eddyb``` in 6b3cc0b8c8094407a3b5ea75f946c682d6d0142a, and it's likely that it was made redundant due to subsequent restructuring of the compiler.

It only affects block type-checking anyways, so its effect does seem limited these days anyway.

19 months agoRollup merge of #103866 - compiler-errors:fn-ctxt-less-state, r=fee1-dead
Dylan DPC [Sat, 5 Nov 2022 06:01:29 +0000 (11:31 +0530)]
Rollup merge of #103866 - compiler-errors:fn-ctxt-less-state, r=fee1-dead

Remove some return-type diagnostic booleans from `FnCtxt`

These can be calculated on-demand

19 months agoRollup merge of #103660 - ozkanonur:master, r=jyn514
Dylan DPC [Sat, 5 Nov 2022 06:01:28 +0000 (11:31 +0530)]
Rollup merge of #103660 - ozkanonur:master, r=jyn514

improve `filesearch::get_or_default_sysroot`

`fn get_or_default_sysroot` is now improved and used in `miri` and `clippy`, and tests are still passing as they should. So we no longer need to implement custom workarounds/hacks to find sysroot in tools like miri/clippy.

Resolves https://github.com/rust-lang/rust/issues/98832

re-opened from #103581

19 months agoRollup merge of #103621 - fee1-dead-contrib:iat-fix-use, r=cjgillot
Dylan DPC [Sat, 5 Nov 2022 06:01:28 +0000 (11:31 +0530)]
Rollup merge of #103621 - fee1-dead-contrib:iat-fix-use, r=cjgillot

Correctly resolve Inherent Associated Types

I don't know if this is the best way to do this, but at least it is one way.

19 months agouse spans in TypeTest rather than mir::Location
Ali MJ Al-Nasrawy [Mon, 3 Oct 2022 10:45:02 +0000 (13:45 +0300)]
use spans in TypeTest rather than mir::Location

Spans are independent of the body being borrow-checked, so they don't
need remapping when promoting type-tests and they yield more specific
error spans inside bodies of closures/inline consts.

19 months agosimplify applying closure requirements
Ali MJ Al-Nasrawy [Mon, 3 Oct 2022 09:14:48 +0000 (12:14 +0300)]
simplify applying closure requirements

Don't use `ConstraintCategory::ClosureBounds`!
Set the category and the span for the promoted constraints to that of
the original constraint earlier than before.
This eliminates the need for `closure_bounds_mapping`.

19 months agoAuto merge of #103992 - weihanglo:update-cargo, r=weihanglo
bors [Sat, 5 Nov 2022 04:01:29 +0000 (04:01 +0000)]
Auto merge of #103992 - weihanglo:update-cargo, r=weihanglo

Update cargo

20 commits in 7e484fc1a766f56dbc95380f45719698e0c82749..9286a1beba5b28b115bad67de2ae91fb1c61eb0b 2022-10-27 15:20:57 +0000 to 2022-11-04 06:41:49 +0000
- chore: Upgrade dependencies (rust-lang/cargo#11328)
- Clean more aggressively in CI (rust-lang/cargo#11335)
- Remove remove_dir_all (rust-lang/cargo#11333)
- test(publish): Cover more wait-for-publish cases (rust-lang/cargo#11327)
- Revert rust-lang/cargo#11183 (rust-lang/cargo#11331)
- fix(semver-check): adapt to a different error for variant not covered (rust-lang/cargo#11332)
- Update curl-sys (rust-lang/cargo#11326)
- Mention fix on build script deadlock (rust-lang/cargo#11325)
- Make cargo forward pre-existing CARGO if set (rust-lang/cargo#11285)
- Clean up workspace dependencies after cargo remove (rust-lang/cargo#11242)
- Update the outdated link for rust-semverver (rust-lang/cargo#11322)
- Fix broken link to compilation entry point (rust-lang/cargo#11317)
- Only remove fingerprints and build script artifacts of the requested package (rust-lang/cargo#10621)
- Newer anyhow features are required (rust-lang/cargo#11316)
- Clean stale git temp files (rust-lang/cargo#11308)
- Report crate size on package and publish (rust-lang/cargo#11270)
- add a note that some warnings (and/or errors) can be auto-fixed (rust-lang/cargo#10989)
- Update libcurl (rust-lang/cargo#11307)
- artifact deps shoud works when target field specified coexists with `optional = true` (rust-lang/cargo#11183)
- Fix singular verb in tests page (rust-lang/cargo#11300)

r? `@ghost`

19 months agoSmall round of typo fixes
Alex Saveau [Sat, 5 Nov 2022 03:05:22 +0000 (20:05 -0700)]
Small round of typo fixes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
19 months agoAuto merge of #103991 - matthiaskrgr:rollup-tj53nte, r=matthiaskrgr
bors [Sat, 5 Nov 2022 01:20:41 +0000 (01:20 +0000)]
Auto merge of #103991 - matthiaskrgr:rollup-tj53nte, r=matthiaskrgr

Rollup of 7 pull requests

Successful merges:

 - #103868 (Use `TraitEngine` (by itself) less)
 - #103878 (Fix artifact version/channel detection for stable)
 - #103946 (Cleanup bind_pattern args)
 - #103956 (Make mir opt unused file check blessable)
 - #103977 (LLVM 16: Switch to using MemoryEffects)
 - #103980 (rustdoc: simplify search results CSS and DOM)
 - #103984 (Refactor tcx mk_const parameters.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

19 months agoSpecify that `break` cannot be used outside of loop *or* labeled block
clubby789 [Sat, 5 Nov 2022 01:11:50 +0000 (01:11 +0000)]
Specify that `break` cannot be used outside of loop *or* labeled block

19 months agoUpdate cargo
Weihang Lo [Fri, 4 Nov 2022 23:50:44 +0000 (23:50 +0000)]
Update cargo

20 commits in 7e484fc1a766f56dbc95380f45719698e0c82749..9286a1beba5b28b115bad67de2ae91fb1c61eb0b
2022-10-27 15:20:57 +0000 to 2022-11-04 06:41:49 +0000
- chore: Upgrade dependencies (rust-lang/cargo#11328)
- Clean more aggressively in CI (rust-lang/cargo#11335)
- Remove remove_dir_all (rust-lang/cargo#11333)
- test(publish): Cover more wait-for-publish cases (rust-lang/cargo#11327)
- Revert rust-lang/cargo#11183 (rust-lang/cargo#11331)
- fix(semver-check): adapt to a different error for variant not covered (rust-lang/cargo#11332)
- Update curl-sys (rust-lang/cargo#11326)
- Mention fix on build script deadlock (rust-lang/cargo#11325)
- Make cargo forward pre-existing CARGO if set (rust-lang/cargo#11285)
- Clean up workspace dependencies after cargo remove (rust-lang/cargo#11242)
- Update the outdated link for rust-semverver (rust-lang/cargo#11322)
- Fix broken link to compilation entry point (rust-lang/cargo#11317)
- Only remove fingerprints and build script artifacts of the requested package (rust-lang/cargo#10621)
- Newer anyhow features are required (rust-lang/cargo#11316)
- Clean stale git temp files (rust-lang/cargo#11308)
- Report crate size on package and publish (rust-lang/cargo#11270)
- add a note that some warnings (and/or errors) can be auto-fixed (rust-lang/cargo#10989)
- Update libcurl (rust-lang/cargo#11307)
- artifact deps shoud works when target field specified coexists with `optional = true` (rust-lang/cargo#11183)
- Fix singular verb in tests page (rust-lang/cargo#11300)

19 months agoRollup merge of #103984 - V0ldek:103974-refactor-mk_const, r=BoxyUwU
Matthias Krüger [Fri, 4 Nov 2022 23:02:06 +0000 (00:02 +0100)]
Rollup merge of #103984 - V0ldek:103974-refactor-mk_const, r=BoxyUwU

Refactor tcx mk_const parameters.

Unroll the `ty::ConstS` parameter to `TyCtxt::mk_const` into separate `ty::ConstKind` and `Ty` parameters.

Signature change is in:

https://github.com/V0ldek/rust/blob/c97fd8183a98d6a89b8fc2e02eb068298e6fb7dc/compiler/rustc_middle/src/ty/context.rs#L2234

and

https://github.com/V0ldek/rust/blob/c97fd8183a98d6a89b8fc2e02eb068298e6fb7dc/compiler/rustc_middle/src/ty/context.rs#L2572-L2575

the rest is callsites.

Closes #103974

r? `@oli-obk`

19 months agoRollup merge of #103980 - notriddle:notriddle/search-results, r=GuillaumeGomez
Matthias Krüger [Fri, 4 Nov 2022 23:02:06 +0000 (00:02 +0100)]
Rollup merge of #103980 - notriddle:notriddle/search-results, r=GuillaumeGomez

rustdoc: simplify search results CSS and DOM

Preview: http://notriddle.com/notriddle-rustdoc-demos/search-results/std/index.html?search=vec

There is a layout change caused by this commit, but it's subtle. You won't notice it unless you're looking for it.

## Before

![image](https://user-images.githubusercontent.com/1593513/200060877-05ae4135-db8d-4d24-8dfa-4c06b8ef671c.png)

## After

![image](https://user-images.githubusercontent.com/1593513/200061474-b0ea9e8d-72c3-401f-9106-072307d9e2ff.png)

19 months agoRollup merge of #103977 - TimNN:memory-effects, r=nikic
Matthias Krüger [Fri, 4 Nov 2022 23:02:05 +0000 (00:02 +0100)]
Rollup merge of #103977 - TimNN:memory-effects, r=nikic

LLVM 16: Switch to using MemoryEffects

This adapts the compiler to the changes required by https://github.com/llvm/llvm-project/commit/304f1d59ca41872c094def3aee0a8689df6aa398.

AFAICT, `WriteOnly` isn't used by the compiler, all `ReadNone` uses were migrated and the remaining use of `ReadOnly` is only for function parameters.

To simplify the FFI, this PR uses an enum to represent `MemoryEffects` across the FFI boundary, which then gets mapped to the matching static factory method when constructing the attribute.

Fixes #103961.

`@rustbot` label +llvm-main

r? `@nikic`

19 months agoRollup merge of #103956 - JakobDegen:tidy-bless, r=jyn514
Matthias Krüger [Fri, 4 Nov 2022 23:02:05 +0000 (00:02 +0100)]
Rollup merge of #103956 - JakobDegen:tidy-bless, r=jyn514

Make mir opt unused file check blessable

Makes it slightly nicer to work with.

Can't write automated test but tested locally via

```
$ touch src/test/mir-opt/random
$ x test tidy // shows failure
$ x test tidy --bless // file gone
```

r? `@jyn514`

19 months agoRollup merge of #103946 - camsteffen:cleanup-bind-pattern, r=cjgillot
Matthias Krüger [Fri, 4 Nov 2022 23:02:05 +0000 (00:02 +0100)]
Rollup merge of #103946 - camsteffen:cleanup-bind-pattern, r=cjgillot

Cleanup bind_pattern args

Fixes #101896

19 months agoRollup merge of #103878 - Mark-Simulacrum:fix-stable-ci-download, r=jyn514
Matthias Krüger [Fri, 4 Nov 2022 23:02:04 +0000 (00:02 +0100)]
Rollup merge of #103878 - Mark-Simulacrum:fix-stable-ci-download, r=jyn514

Fix artifact version/channel detection for stable

On stable, our artifacts are uploaded with the raw version number (e.g., 1.65.0), not the channel. This adjusts our detection logic to use the version number from src/version when we detect the stable channel.

This is really only important for stable channel re-builds, I think, but those do happen from time to time. I'm backporting a similar commit in https://github.com/rust-lang/rust/pull/103859 to make that PR pass CI.

19 months agoRollup merge of #103868 - compiler-errors:trait-engine-less, r=jackh726
Matthias Krüger [Fri, 4 Nov 2022 23:02:04 +0000 (00:02 +0100)]
Rollup merge of #103868 - compiler-errors:trait-engine-less, r=jackh726

Use `TraitEngine` (by itself) less

Replace `TraitEngine` in favor of `ObligationCtxt` or `fully_solve_*`, improving code readability.

19 months agorustdoc: clean up `.logo-container` layout CSS
Michael Howell [Fri, 4 Nov 2022 22:13:13 +0000 (15:13 -0700)]
rustdoc: clean up `.logo-container` layout CSS

This commit should result in no appearance changes.

To make the logo container exactly the desired height, you want to get rid
of the part of the box used for typographic descenders (you know, the part
of g, y, and j that descends below the baseline). After all, it contains no
text, but the space is still left open in the layout by default, because
`<img>` is `display:inline`. The CSS used to employ three different tricks
to accomplish this:

* By making `.sidebar .logo-container` a flex container, the image becomes
  a flex item and is [blockified], without synthesizing any inline boxes.
  No inline boxes means no descenders.
* By giving `.mobile-topbar .logo-container` a max-height exactly the same
  as the height of the image plus the padding, the descender area gets
  cut off.
* By setting `.sub-logo-container { line-height: 0 }`, we ensure that the
  only box that contributes to the height of the line box is the image
  itself, and not any zero-content text boxes that neighbor it. See the
  [logical height algorithm].

This commit gets rid of the first two hacks, leaving only the third,
since it requires only one line of code to accomplish and doesn't require
setting the value based on math.

[blockified]: https://drafts.csswg.org/css-flexbox-1/#flex-items
[logical height algorithm]: https://www.w3.org/TR/css-inline-3/#inline-height

19 months agoAuto merge of #103298 - ferrocene:pa-compile-flags-last, r=jyn514
bors [Fri, 4 Nov 2022 22:24:46 +0000 (22:24 +0000)]
Auto merge of #103298 - ferrocene:pa-compile-flags-last, r=jyn514

Ensure that compile-flags arguments are the last in UI tests

Before this PR, compiletest would add `-L path/to/aux` at the end of the rustc flags, even after the custom ones set with the compile-flags header comment. This made it impossible to check how rustc would behave when a flag requiring an argument was passed without the argument, because the argument would become `-L`.

This PR fixes that by adding the `-L path/to/aux` before the arguments defined in compile-flags, at least for UI tests. Other test suites might either be fixed as well by this change, or still present the old behavior (`-L` is now always passed before, but other tests suites might add additional flags after the custom ones).

19 months agoRefactor tcx mk_const parameters.
Mateusz [Fri, 4 Nov 2022 20:33:32 +0000 (20:33 +0000)]
Refactor tcx mk_const parameters.

19 months agorustdoc: get rid of CSS/DOM `div.desc span`, which isn't really needed
Michael Howell [Fri, 4 Nov 2022 20:19:33 +0000 (13:19 -0700)]
rustdoc: get rid of CSS/DOM `div.desc span`, which isn't really needed

19 months agoAuto merge of #103978 - matthiaskrgr:rollup-iym9kmg, r=matthiaskrgr
bors [Fri, 4 Nov 2022 19:43:36 +0000 (19:43 +0000)]
Auto merge of #103978 - matthiaskrgr:rollup-iym9kmg, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #103367 (Remove std's transitive dependency on cfg-if 0.1)
 - #103397 (Port `dead_code` lints to be translatable.)
 - #103681 (libtest: run all tests in their own thread, if supported by the host)
 - #103792 (Migrate `codegen_ssa` to diagnostics structs - [Part 2])
 - #103897 (asm: Work around LLVM bug on AArch64)
 - #103937 (minor changes to make method lookup diagnostic code easier to read)
 - #103958 (Test tidy should not count untracked paths towards entries limit)
 - #103964 (Give a specific lint for unsafety not being inherited)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

19 months agorustdoc: simplify search results CSS and DOM
Michael Howell [Fri, 4 Nov 2022 19:34:24 +0000 (12:34 -0700)]
rustdoc: simplify search results CSS and DOM

There is a layout change caused by this commit, but it's subtle. You won't
notice it unless you're looking for it.

19 months agoLLVM 16: Switch to using MemoryEffects
Tim Neumann [Fri, 4 Nov 2022 16:20:42 +0000 (16:20 +0000)]
LLVM 16: Switch to using MemoryEffects

19 months agoRollup merge of #103964 - clubby789:lint-enclosing-unsafe, r=compiler-errors
Matthias Krüger [Fri, 4 Nov 2022 17:52:29 +0000 (18:52 +0100)]
Rollup merge of #103964 - clubby789:lint-enclosing-unsafe, r=compiler-errors

Give a specific lint for unsafety not being inherited

In cases like
```rs
static mut FOO: u64 = 0;
fn main() {
    unsafe {static BAR: u64 = FOO;}
}
```
and
```rs
fn foo() {
  unsafe {
    fn bar() {
      unsafe_call();
    }
  }
}
```
Specifically inform the user that the unsafety is not inherited for the seperate enclosing items
Fixes #94077
r? compiler-errors
`@rustbot` label +A-diagnostics

19 months agoRollup merge of #103958 - chenyukang:yukang/fix-103951-count-limit, r=jyn514
Matthias Krüger [Fri, 4 Nov 2022 17:52:28 +0000 (18:52 +0100)]
Rollup merge of #103958 - chenyukang:yukang/fix-103951-count-limit, r=jyn514

Test tidy should not count untracked paths towards entries limit

Fixes #103951
r? `@jyn514`

19 months agoRollup merge of #103937 - BoxyUwU:misc_cleanups, r=compiler-errors
Matthias Krüger [Fri, 4 Nov 2022 17:52:28 +0000 (18:52 +0100)]
Rollup merge of #103937 - BoxyUwU:misc_cleanups, r=compiler-errors

minor changes to make method lookup diagnostic code easier to read

The end result of around 4 days of trying to understand this 1000+ line long function- a bunch of tiny nitpicks

r? `@compiler-errors`

19 months agoRollup merge of #103897 - Amanieu:llvm-58384, r=davidtwco
Matthias Krüger [Fri, 4 Nov 2022 17:52:27 +0000 (18:52 +0100)]
Rollup merge of #103897 - Amanieu:llvm-58384, r=davidtwco

asm: Work around LLVM bug on AArch64

Upstream issue: https://github.com/llvm/llvm-project/issues/58384

LLVM gets confused if we assign a 32-bit value to a 64-bit register, so pass the 32-bit register name to LLVM in that case.

19 months agoRollup merge of #103792 - JhonnyBillM:migrate-codegen-ssa-to-diagnostics-structs...
Matthias Krüger [Fri, 4 Nov 2022 17:52:27 +0000 (18:52 +0100)]
Rollup merge of #103792 - JhonnyBillM:migrate-codegen-ssa-to-diagnostics-structs-pt2, r=davidtwco

Migrate `codegen_ssa` to diagnostics structs - [Part 2]

Completes migrating `link.rs` in `codegen_ssa` module.

_Part 1 - https://github.com/rust-lang/rust/pull/102612_

r? `@davidtwco`

19 months agoRollup merge of #103681 - RalfJung:libtest-thread, r=thomcc
Matthias Krüger [Fri, 4 Nov 2022 17:52:26 +0000 (18:52 +0100)]
Rollup merge of #103681 - RalfJung:libtest-thread, r=thomcc

libtest: run all tests in their own thread, if supported by the host

This reverts the threading changes of https://github.com/rust-lang/rust/pull/56243, which made it so that with `-j1`, the test harness does not spawn any threads. Those changes were done to enable Miri to run the test harness, but Miri supports threads nowadays, so this is no longer needed. Using a thread for each test is useful because the thread's name can be set to the test's name which makes panic messages consistent between `-j1` and `-j2` runs and also a bit more readable.

I did not revert the HashMap changes of https://github.com/rust-lang/rust/pull/56243; using a deterministic map seems fine for the test harness and the more deterministic testing is the better.

Fixes https://github.com/rust-lang/rust/issues/59122
Fixes https://github.com/rust-lang/rust/issues/70492

19 months agoRollup merge of #103397 - crlf0710:port_dead_code_lint, r=davidtwco
Matthias Krüger [Fri, 4 Nov 2022 17:52:26 +0000 (18:52 +0100)]
Rollup merge of #103397 - crlf0710:port_dead_code_lint, r=davidtwco

Port `dead_code` lints to be translatable.

This adds an additional comma to lists with three or more items, to be consistent with list formatters like `icu4x`.

r? `@davidtwco`

19 months agoRollup merge of #103367 - chbaker0:update-std-getrandom, r=thomcc
Matthias Krüger [Fri, 4 Nov 2022 17:52:25 +0000 (18:52 +0100)]
Rollup merge of #103367 - chbaker0:update-std-getrandom, r=thomcc

Remove std's transitive dependency on cfg-if 0.1

After https://github.com/rust-lang/rust/pull/101946 this completes the move to cfg-if 1.0 by:
* Updating getrandom 0.1.14->0.1.16
* Updating panic_abort's and unwind's dep to cfg-if 1.0

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

19 months agoSome tracing and comment cleanups
Oli Scherer [Thu, 20 Oct 2022 09:39:09 +0000 (09:39 +0000)]
Some tracing and comment cleanups

19 months agoAuto merge of #101703 - nicholasbishop:bishop-add-uefi-ci-2, r=jyn514
bors [Fri, 4 Nov 2022 17:00:24 +0000 (17:00 +0000)]
Auto merge of #101703 - nicholasbishop:bishop-add-uefi-ci-2, r=jyn514

Add QEMU test for x86_64-unknown-uefi

The UEFI targets don't have std support yet, so the normal tests don't work. However, we can compile a simple no-std program and run it under QEMU to at least check that the target compiles, links, and runs.

Tested locally with: `src/ci/docker/run.sh x86_64-uefi`

19 months agoRemove an option and choose a behaviour-preserving default instead.
Oli Scherer [Fri, 4 Nov 2022 16:28:01 +0000 (16:28 +0000)]
Remove an option and choose a behaviour-preserving default instead.

19 months agoimprove `filesearch::get_or_default_sysroot` r=ozkanonur
Onur Özkan [Fri, 28 Oct 2022 07:20:51 +0000 (10:20 +0300)]
improve `filesearch::get_or_default_sysroot` r=ozkanonur

Signed-off-by: Onur Özkan <work@onurozkan.dev>
19 months agotest tidy should not count untracked paths towards entries limit
yukang [Fri, 4 Nov 2022 08:56:48 +0000 (16:56 +0800)]
test tidy should not count untracked paths towards entries limit

19 months agoAuto merge of #103962 - matthiaskrgr:rollup-9av8i6k, r=matthiaskrgr
bors [Fri, 4 Nov 2022 13:47:37 +0000 (13:47 +0000)]
Auto merge of #103962 - matthiaskrgr:rollup-9av8i6k, r=matthiaskrgr

Rollup of 7 pull requests

Successful merges:

 - #103680 (CStr: add some doc links)
 - #103780 (Fix late-bound lifetime closure ICEs in HIR typeck and MIR borrowck)
 - #103845 (Add track_caller to some Lock methods)
 - #103935 (Remove rustdoc clean::Visibility type)
 - #103941 (Fixed typos)
 - #103950 (Fix ICE when negative impl is collected during eager mono)
 - #103953 (Remove unused argument from `throw_unresolved_import_error`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

19 months agoFormatting changes + add UI test
clubby789 [Fri, 4 Nov 2022 12:57:42 +0000 (12:57 +0000)]
Formatting changes + add UI test

19 months agoGive a specific lint for unsafety not being inherited
clubby789 [Fri, 4 Nov 2022 12:25:40 +0000 (12:25 +0000)]
Give a specific lint for unsafety not being inherited

19 months agofake a base to suppress later extra error message
yukang [Thu, 13 Oct 2022 22:52:23 +0000 (06:52 +0800)]
fake a base to suppress later extra error message

19 months agoRollup merge of #103953 - TaKO8Ki:remove-unused-arg-from-throw_unresolved_import_erro...
Matthias Krüger [Fri, 4 Nov 2022 11:18:03 +0000 (12:18 +0100)]
Rollup merge of #103953 - TaKO8Ki:remove-unused-arg-from-throw_unresolved_import_error, r=oli-obk

Remove unused argument from `throw_unresolved_import_error`

`throw_unresolved_import_error` does not need the second argument.

19 months agoRollup merge of #103950 - nbdd0121:master, r=tmiasko
Matthias Krüger [Fri, 4 Nov 2022 11:18:03 +0000 (12:18 +0100)]
Rollup merge of #103950 - nbdd0121:master, r=tmiasko

Fix ICE when negative impl is collected during eager mono

```rust
trait Foo {
    fn foo() {}
}

impl !Foo for () {}
```

This code will currently cause an ICE when mono collection mode is "eager" (with `-C link-dead-code=y` or `-Z print-mono-items=eager`.

19 months agoRollup merge of #103941 - douweschulte:patch-1, r=jyn514
Matthias Krüger [Fri, 4 Nov 2022 11:18:02 +0000 (12:18 +0100)]
Rollup merge of #103941 - douweschulte:patch-1, r=jyn514

Fixed typos

Fixed a typo that has been found on two locations in comments.

19 months agoRollup merge of #103935 - GuillaumeGomez:remove-rustdoc-visibility-ty, r=notriddle
Matthias Krüger [Fri, 4 Nov 2022 11:18:02 +0000 (12:18 +0100)]
Rollup merge of #103935 - GuillaumeGomez:remove-rustdoc-visibility-ty, r=notriddle

Remove rustdoc clean::Visibility type

Fixes #90852.

Follow-up of https://github.com/rust-lang/rust/pull/103690.

This PR completely removes the rustdoc `clean::Visibility` type to use the `rustc_middle` one instead. I don't think there will be any impact on perf.

r? `@notriddle`

19 months agoRollup merge of #103845 - camsteffen:data-structures-track-caller, r=compiler-errors
Matthias Krüger [Fri, 4 Nov 2022 11:18:01 +0000 (12:18 +0100)]
Rollup merge of #103845 - camsteffen:data-structures-track-caller, r=compiler-errors

Add track_caller to some Lock methods

Would have helped to diagnose #103844.

19 months agoRollup merge of #103780 - compiler-errors:bound-closure-lifetimes, r=jackh726
Matthias Krüger [Fri, 4 Nov 2022 11:18:01 +0000 (12:18 +0100)]
Rollup merge of #103780 - compiler-errors:bound-closure-lifetimes, r=jackh726

Fix late-bound lifetime closure ICEs in HIR typeck and MIR borrowck

During HIR typeck, we need to teach astconv to treat late-bound regions within a closure body as free, fixing escaping bound vars ICEs in both of the issues below.

However, this then gets us to MIR borrowck, which itself needs to be taught how to instantiate free region vids for late-bound regions that come from items that _aren't_ the typeck root (for now, just closures).

Fixes #103771
Fixes #103736

19 months agoRollup merge of #103680 - RalfJung:cstr-links, r=JohnTitor
Matthias Krüger [Fri, 4 Nov 2022 11:18:00 +0000 (12:18 +0100)]
Rollup merge of #103680 - RalfJung:cstr-links, r=JohnTitor

CStr: add some doc links

19 months agoAuto merge of #103098 - Amanieu:asm-tied-fixed, r=bjorn3
bors [Fri, 4 Nov 2022 10:39:04 +0000 (10:39 +0000)]
Auto merge of #103098 - Amanieu:asm-tied-fixed, r=bjorn3

asm: Match clang behavior for inlateout fixed register operands

We have 2 options for representing LLVM constraints for `inlateout` operands on a fixed register (e.g. `r0`): `={r0},0` or `={r0},{r0}`.

This PR changes the behavior to the latter, which matches the behavior of Clang since https://reviews.llvm.org/D87279.

19 months agoAuto merge of #103954 - matthiaskrgr:rollup-tskpxnj, r=matthiaskrgr
bors [Fri, 4 Nov 2022 07:26:56 +0000 (07:26 +0000)]
Auto merge of #103954 - matthiaskrgr:rollup-tskpxnj, r=matthiaskrgr

Rollup of 10 pull requests

Successful merges:

 - #103825 (Remove let_underscore_must_use from list of uplifted lints)
 - #103884 (Add visit_fn_ret_ty to hir intravisit)
 - #103892 (Properly render asyncness for trait fns without default body)
 - #103905 (rustdoc: remove redundant mobile CSS `.sidebar-elems { background }`)
 - #103912 (Add howto for adding new targets)
 - #103915 (Improve use of ErrorGuaranteed and code cleanup)
 - #103930 (Move some tests from `src/test/ui` to more reasonable places)
 - #103931 (Add note to RELEASES.md regarding issue 102754.)
 - #103938 (rustdoc: clean up hardcoded CSS border color on search results)
 - #103940 (rustdoc: remove no-op CSS `#main-content > .item-info { margin-top: 0 }`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

19 months agoMake mir opt unused file check blessable
Jakob Degen [Fri, 4 Nov 2022 06:19:59 +0000 (23:19 -0700)]
Make mir opt unused file check blessable

19 months agoRollup merge of #103940 - notriddle:notriddle/main-content-item-info-margin-top,...
Matthias Krüger [Fri, 4 Nov 2022 05:40:34 +0000 (06:40 +0100)]
Rollup merge of #103940 - notriddle:notriddle/main-content-item-info-margin-top, r=GuillaumeGomez

rustdoc: remove no-op CSS `#main-content > .item-info { margin-top: 0 }`

When this line was added in 04b4c40682c01cad8f9bc8d5b3907be91d6f81d4, it overrode a negative `margin-top` that was set on it by default.

https://github.com/rust-lang/rust/blob/04b4c40682c01cad8f9bc8d5b3907be91d6f81d4/src/librustdoc/html/static/rustdoc.css#L500-L516

That negative top margin was removed in 593d6d1cb15c55c88319470dabb40126c7b7f1e2.

19 months agoRollup merge of #103938 - notriddle:notriddle/search-results-border-bottom, r=Guillau...
Matthias Krüger [Fri, 4 Nov 2022 05:40:34 +0000 (06:40 +0100)]
Rollup merge of #103938 - notriddle:notriddle/search-results-border-bottom, r=GuillaumeGomez

rustdoc: clean up hardcoded CSS border color on search results

Hardcoded colors in rustdoc.css should usually be avoided.

Preview: http://notriddle.com/notriddle-rustdoc-demos/border-bottom-search/test_dingus/?search=test