Commit Graph

209529 Commits

Author SHA1 Message Date
Nilstrieb
27e0f03d41
Add internal descriptions to a few queries 2022-11-05 17:54:15 +01:00
Nilstrieb
04583f29c8
Simplify code 2022-11-05 17:54:06 +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
Michael Howell
a69d43493a rustdoc: use ThinVec and Box<str> to shrink clean::ItemKind 2022-11-05 09:02:10 -07: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
Nilstrieb
36be251a35
Merge QueryDescription into QueryConfig
`QueryDescription` has gone through a lot of refactoring and doesn't
make sense anymore.
2022-11-05 16:24:13 +01:00
Vadim Petrochenkov
43bea6cf69 resolve: Fill effective visibilities for import def ids in a separate pass
This should result in less update calls than doing it repeatedly during the fix point iteration.
2022-11-05 17:55:20 +04: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
Caio
f63ac6a13f Tidy 2022-11-05 09:59:27 -03:00
Caio
c72c646625 Move some tests to more reasonable directories 2022-11-05 09:58:13 -03:00
Vadim Petrochenkov
448261a78a privacy: Check effective visibility invariants 2022-11-05 16:25:41 +04:00
Vadim Petrochenkov
bb401bd04d privacy: Print effective visibilities of constructors 2022-11-05 16:22:23 +04:00
Vadim Petrochenkov
24093fc6bd resolve: More detailed effective visibility tracking for imports
Also drop `extern` blocks from the effective visibility table, they are nominally private and it doesn't make sense to keep them there.
2022-11-05 15:46:22 +04:00
AndyJado
e49d10db14 first move on a nested span_label
Apply suggestions from code review

Co-authored-by: David Wood <agile.lion3441@fuligin.ink>
2022-11-05 19:43:48 +08:00
Ralf Jung
dad327090a fix a comment in UnsafeCell::new 2022-11-05 12:27:43 +01:00
Mateusz Mikuła
d5899efbda Update several crates for improved support of the new targets
This helps with `*-windows-gnullvm` targets
2022-11-05 12:19:55 +01: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
47e6304e32
Rollup merge of #103995 - SUPERCILEX:typos, r=Dylan-DPC
Small round of typo fixes
2022-11-05 11:31:30 +05:30
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
9e67f6a68d
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
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
Alex Saveau
849d89b031
Small round of typo fixes
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2022-11-04 20:06:18 -07: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
b101f3a865
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:

c97fd8183a/compiler/rustc_middle/src/ty/context.rs (L2234)

and

c97fd8183a/compiler/rustc_middle/src/ty/context.rs (L2572-L2575)

the rest is callsites.

Closes #103974

r? `@oli-obk`
2022-11-05 00:02:06 +01: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
Matthias Krüger
7b518af5d9
Rollup merge of #103946 - camsteffen:cleanup-bind-pattern, r=cjgillot
Cleanup bind_pattern args

Fixes #101896
2022-11-05 00:02:05 +01:00
Matthias Krüger
68c8d6d1c1
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.
2022-11-05 00:02:04 +01:00
Matthias Krüger
ad01a37ca9
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.
2022-11-05 00:02:04 +01:00
Michael Howell
cb184bb023 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-04 16:00:57 -07:00
bors
81ff7e7385 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).
2022-11-04 22:24:46 +00:00
Michael Goulet
4e7fc663cc Don't silently eat label before block in block-like expr 2022-11-04 21:35:58 +00:00
Michael Goulet
a0cdc85b32 Remove in_tail_expr from FnCtxt 2022-11-04 21:17:39 +00:00
Mateusz
c97fd8183a
Refactor tcx mk_const parameters. 2022-11-04 20:33:32 +00:00
Michael Howell
4bd6748bb9 rustdoc: get rid of CSS/DOM div.desc span, which isn't really needed 2022-11-04 13:19:33 -07:00
bors
09508489ef 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
2022-11-04 19:43:36 +00:00
Michael Howell
b30c4d1932 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.
2022-11-04 12:40:50 -07:00
León Orell Valerian Liehr
5ccaed212e rustdoc: create helper GenericParamDef::lifetime 2022-11-04 20:10:53 +01:00