Commit Graph

136884 Commits

Author SHA1 Message Date
Dylan DPC
170ad4a0ab
Rollup merge of #103986 - compiler-errors:oh-no-bad-block-should-not-have-label, r=lcnr
Don't silently eat label before block in block-like expr

Fixes #103983
cc #92823 (where the regression was introduced)
2022-11-07 18:35:24 +05:30
Yuki Okushi
fe6161a6a5
Rollup merge of #104065 - GuillaumeGomez:css-migrate-logo-filter, r=notriddle
Migrate rust logo filter to CSS variables
2022-11-07 09:46:28 +09:00
Yuki Okushi
458b132bf9
Rollup merge of #104062 - notriddle:notriddle/sidebar-filler, r=GuillaumeGomez
rustdoc: remove unused CSS `#sidebar-filler`

This hack was removed in 6a5f8b1aef, but the CSS was left in.
2022-11-07 09:46:27 +09:00
Yuki Okushi
19c780ab13
Rollup merge of #103914 - nnethercote:close-42326, r=petrochenkov
Make underscore_literal_suffix a hard error.

It's been a warning for 5.5 years. Time to make it a hard error.

Closes #42326.

r? ``@pnkfelix``
2022-11-07 09:46:26 +09:00
Yuki Okushi
63f78d17b4
Rollup merge of #103885 - fmease:rustdoc-various-cross-crate-reexport-fixes, r=cjgillot,GuillaumeGomez
rustdoc: various cross-crate reexport fixes

Fixes for various smaller cross-crate reexport issues.
The PR is split into several commits for easier review. Will be squashed after approval.

Most notable changes:

* We finally render late-bound lifetimes in the generic parameter list of cross-crate functions & methods.
  Previously, we would display the re-export of `pub fn f<'s>(x: &'s str) {}` as `pub fn f(x: &'s str)`
* We now render unnamed parameters of cross-crate functions and function pointers as underscores
  since that's exactly what we do for local definitions, too. Mentioned as a bug in #44306.
* From now on, the rendering of cross-crate trait-object types is more correct:
  * `for<>` parameter lists (for higher-ranked lifetimes) are now shown
  * the return type of `Fn{,Mut,Once}` trait bounds is now displayed

Regarding the last list item, here is a diff for visualization (before vs. after):

```patch
- dyn FnOnce(&'any str) + 'static
+ dyn for<'any> FnOnce(&'any str) -> bool + 'static
```

The redundant `+ 'static` will be removed in a follow-up PR that will hide trait-object lifetime-bounds if they coincide with [their default](https://doc.rust-lang.org/reference/lifetime-elision.html#default-trait-object-lifetimes) (see [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/clean_middle_ty.3A.20I.20need.20to.20add.20a.20parameter/near/307143097)). `FIXME(fmease)`s were added.

``@rustbot`` label A-cross-crate-reexports
r? ``@GuillaumeGomez``
2022-11-07 09:46:25 +09:00
Nicholas Nethercote
dba6fc3ef5 Make underscore_literal_suffix a hard error.
It's been a warning for 5.5 years. Time to make it a hard error.

Closes #42326.
2022-11-07 10:00:36 +11:00
Guillaume Gomez
0e23d90e26 Extend rust-logo GUI test to check there is no filter for other logos 2022-11-06 20:20:43 +01:00
bors
7eef946fc0 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
2022-11-06 17:48:33 +00:00
Guillaume Gomez
24d86a1c08 Migrate rust logo filter to CSS variables 2022-11-06 18:23:13 +01:00
Michael Howell
b34fdd32bb rustdoc: remove unused CSS #sidebar-filler
This hack was removed in 6a5f8b1aef, but the
CSS was left in.
2022-11-06 09:55:16 -07:00
bors
88935e0bea 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
2022-11-06 08:13:56 +00:00
Matthias Krüger
619add319f
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.
2022-11-06 08:35:28 +01:00
Matthias Krüger
ef0d79f865
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``
2022-11-06 08:35:27 +01:00
Matthias Krüger
c013962695
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
2022-11-06 08:35:26 +01:00
Matthias Krüger
131ef95808
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 ab5a2bc731/src/bootstrap/builder.rs (L334) would match with JsonStd and remove the paths that Std matched. So I did [this](ffd4078264/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
2022-11-06 08:35:26 +01:00
Matthias Krüger
58f5d57b5d
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
2022-11-06 08:35:26 +01:00
bors
e30fb6a26f 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
2022-11-06 05:26:09 +00:00
Mara Bos
84fe2ee9d2 Add more nonsense to weird-exprs.rs. 2022-11-06 01:37:22 +01:00
Michael Howell
21894801c6 rustdoc: add test case for huge logo 2022-11-05 14:26:13 -07:00
bors
1286ee23e4 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>
2022-11-05 20:39:06 +00:00
Michael Goulet
ff8f84ccf6 Bless more tests 2022-11-05 18:05:45 +00:00
Michael Goulet
d9891563d3 Merge conflicts and rebase onto master 2022-11-05 18:05:44 +00:00
Michael Goulet
29dccfe9e4 Bless chalk tests 2022-11-05 18:05:44 +00:00
Michael Goulet
2257ba92db Adjust diagnostics, bless tests 2022-11-05 18:05:44 +00:00
viandoxdev
900af414a3
fix out dir being wrong in json 2022-11-05 18:30:01 +01:00
Matthias Krüger
e51e4a4ecf
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`
2022-11-05 18:06:07 +01:00
Matthias Krüger
51287f264c
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.
2022-11-05 18:06:06 +01:00
Matthias Krüger
305cb7133f
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.
2022-11-05 18:06:06 +01:00
Matthias Krüger
3eac639e1e
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
2022-11-05 18:06:05 +01:00
Guillaume Gomez
8e2956d4a9 Extend GUI test for run button 2022-11-05 17:22:38 +01:00
Guillaume Gomez
ffb28690aa Migrate test-arrow to CSS variables 2022-11-05 17:22:25 +01:00
Guillaume Gomez
666873b1bb Update GUI test for bottom border color 2022-11-05 16:43:09 +01:00
Guillaume Gomez
94ba7f09df Fix search result bottom border color 2022-11-05 16:43:08 +01:00
Deadbeef
b1994ce806 Do not make typo suggestions when suggesting pattern matching
Fixes #103909.
2022-11-05 15:33:25 +00:00
bors
6b8d9dd0a0 Auto merge of #103831 - chenyukang:yukang/fix-103751-ice, r=nagisa
Fix capacity overflow issue during transmutability check

Fixes #103751
2022-11-05 13:48:30 +00:00
bors
b0f3940c35 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.
2022-11-05 11:07:50 +00:00
bors
452cf4f710 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
2022-11-05 07:32:09 +00:00
Dylan DPC
61553d1784
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
2022-11-05 11:31:30 +05:30
Dylan DPC
2d8f0838b1
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 6b3cc0b8c8, 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.
2022-11-05 11:31:29 +05:30
Dylan DPC
bd9e6e05d2
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
2022-11-05 11:31:28 +05:30
Dylan DPC
3450aa38d0
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.
2022-11-05 11:31:28 +05:30
Ali MJ Al-Nasrawy
02f78fdb94 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.
2022-11-05 07:36:47 +03:00
Ali MJ Al-Nasrawy
df668b9fb9 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`.
2022-11-05 07:36:42 +03:00
bors
5b3e909075 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`
2022-11-05 04:01:29 +00:00
bors
aebf7c4a0e 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
2022-11-05 01:20:41 +00:00
clubby789
2f882c014f Specify that break cannot be used outside of loop *or* labeled block 2022-11-05 01:12:58 +00:00
Weihang Lo
bfce227c6a
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)
2022-11-04 23:51:04 +00:00
Matthias Krüger
ded8d0332e
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)
2022-11-05 00:02:06 +01:00
Matthias Krüger
f6ca5aa19a
Rollup merge of #103977 - TimNN:memory-effects, r=nikic
LLVM 16: Switch to using MemoryEffects

This adapts the compiler to the changes required by 304f1d59ca.

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`
2022-11-05 00:02:05 +01:00
Matthias Krüger
b1a47d2fd9
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`
2022-11-05 00:02:05 +01:00