Commit Graph

222216 Commits

Author SHA1 Message Date
fee1-dead
312cad1f74
Rollup merge of #110387 - nnethercote:rm-use-rustc_hir-as-ast, r=fee1-dead
Don't `use rustc_hir as ast`(!)

It makes for confusing code.

This was introduced in a large commit in #67886 that rearranged a lot of `use` statements. I suspect it was an accident.
2023-04-16 14:24:33 +08:00
fee1-dead
4d868c9508
Rollup merge of #110379 - ehuss:unignore-tests, r=compiler-errors
Update some ignored tests.

This unignores some tests which no longer need to be ignored (see individual commits for reasons why). This also adds some descriptions to why tests are ignored so they can be seen in the test output.
2023-04-16 14:24:33 +08:00
fee1-dead
ff39942d33
Rollup merge of #110376 - aDotInTheVoid:doc-comment, r=jyn514
Convert comment to doc comment on `Interner::get`.
2023-04-16 14:24:32 +08:00
John Bobbo
d0603fdafa
Use a saturating_mul instead of a checked_mul
and `unwrap` in `core::intrinsics`.
2023-04-15 22:40:26 -07:00
Nicholas Nethercote
1ffa331c72 Don't use rustc_hir as ast(!)
It makes for confusing code.

This was introduced in a large commit in #67886 that rearranged a lot of
`use` statements. I suspect it was an accident.
2023-04-16 15:03:17 +10:00
Nicholas Nethercote
d2b5a64579 Simplify CloneLiftImpls and TrivialTypeTraversalImpls.
They both allow for a lifetime other than `'tcx`, but this isn't needed.
2023-04-16 14:19:50 +10:00
Nicholas Nethercote
32f6e7a38e Remove EnumTypeTraversalImpl.
I suspect this macro was around before `TypeFoldable`/`TypeVisitable`
were derivable. But now it's only used for two types, `Result` and
`Option`. Removing the macro and implementing the traits for those types
by hand makes the code much simpler.
2023-04-16 13:49:12 +10:00
bors
2a71115261 Auto merge of #105888 - skyzh:skyzh/suggest-lifetime-closure, r=compiler-errors
suggest lifetime for closure parameter type when mismatch

This is a draft PR, will add test cases later and be ready for review.

This PR fixes https://github.com/rust-lang/rust/issues/105675 by adding a diagnostics suggestion. Also a partial fix to https://github.com/rust-lang/rust/issues/105528.

The following code will have a compile error now:

```
fn const_if_unit(input: bool) -> impl for<'a> FnOnce(&'a ()) -> usize {
    let x = |_| 1;
    x
}
```

Before this PR:

```
error[E0308]: mismatched types
 --> src/lib.rs:3:5
  |
3 |     x
  |     ^ one type is more general than the other
  |
  = note: expected trait `for<'a> FnOnce<(&'a (),)>`
             found trait `FnOnce<(&(),)>`
note: this closure does not fulfill the lifetime requirements
 --> src/lib.rs:2:13
  |
2 |     let x = |_| 1;
  |             ^^^

error: implementation of `FnOnce` is not general enough
 --> src/lib.rs:3:5
  |
3 |     x
  |     ^ implementation of `FnOnce` is not general enough
  |
  = note: closure with signature `fn(&'2 ()) -> usize` must implement `FnOnce<(&'1 (),)>`, for any lifetime `'1`...
  = note: ...but it actually implements `FnOnce<(&'2 (),)>`, for some specific lifetime `'2`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `rust-test` due to 2 previous errors
```

After this PR:

```
error[E0308]: mismatched types
 --> src/lib.rs:3:5
  |
3 |     x
  |     ^ one type is more general than the other
  |
  = note: expected trait `for<'a> FnOnce<(&'a (),)>`
             found trait `FnOnce<(&(),)>`
note: this closure does not fulfill the lifetime requirements
 --> src/lib.rs:2:13
  |
2 |     let x = |_| 1;
  |             ^^^
help: consider changing the type of the closure parameters
  |
2 |     let x = |_: &_| 1;
  |             ~~~~~~~

error: implementation of `FnOnce` is not general enough
 --> src/lib.rs:3:5
  |
3 |     x
  |     ^ implementation of `FnOnce` is not general enough
  |
  = note: closure with signature `fn(&'2 ()) -> usize` must implement `FnOnce<(&'1 (),)>`, for any lifetime `'1`...
  = note: ...but it actually implements `FnOnce<(&'2 (),)>`, for some specific lifetime `'2`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `rust-test` due to 2 previous errors
```

After applying the suggestion, it compiles. The suggestion might not always be correct as the generation procedure of that suggestion is quite simple...
2023-04-16 03:06:46 +00:00
bors
c6fb7b9815 Auto merge of #110375 - JohnTitor:rollup-ghvdaxm, r=JohnTitor
Rollup of 8 pull requests

Successful merges:

 - #110033 (Add 1.69.0 release notes)
 - #110272 (fix: skip implied bounds if unconstrained lifetime exists)
 - #110307 (Allow everyone to set the beta-nominated label)
 - #110347 (Add intra-doc links to size_of_* functions)
 - #110350 (Add a UI test for #79605)
 - #110356 (Fix `x test rust-installer` when `cargo` is set to a relative path)
 - #110364 (remove redundant clones)
 - #110366 (fix some clippy::complexity)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-04-16 00:07:06 +00:00
Nicholas Nethercote
4460a1dc28 Remove TypeSuper{Foldable,Visitable} impls for Region.
These traits exist so that folders/visitors can recurse into types of
interest: binders, types, regions, predicates, and consts. But `Region`
is non-recursive and cannot contain other types of interest, so its
methods in these traits are trivial.

This commit inlines and removes those trivial methods.
2023-04-16 09:11:43 +10:00
Eric Huss
a4e851cf62 Add some reasons why tests are ignored. 2023-04-15 16:11:42 -07:00
Eric Huss
3a645659b8 Unignore issue-65918
This test was fixed by https://github.com/rust-lang/rust/pull/65989
2023-04-15 15:23:32 -07:00
Yuki Okushi
a8983749bd
Rollup merge of #110366 - matthiaskrgr:compl_123, r=Nilstrieb
fix some clippy::complexity

r? `@Nilstrieb`
2023-04-16 06:55:24 +09:00
Yuki Okushi
99e59dbef3
Rollup merge of #110364 - matthiaskrgr:anti_clone, r=Nilstrieb
remove redundant clones
2023-04-16 06:55:23 +09:00
Yuki Okushi
be2e8078d7
Rollup merge of #110356 - jyn514:rust-installer-tests, r=ozkanonur
Fix `x test rust-installer` when `cargo` is set to a relative path

Previously, this would give an error because the shell script had a different working directory:

```
test: basic_install
$ sh /home/jyn/src/rust/src/tools/rust-installer/gen-installer.sh --image-dir=/home/jyn/src/rust/src/tools/rust-installer/test/image1 --work-dir=/home/jyn/src/rust/build/x86_64-unknown-linux-gnu/test/rust-installer/workdir --output-dir=/home/jyn/src/rust/build/x86_64-unknown-linux-gnu/test/rust-installer/outdir
/home/jyn/src/rust/src/tools/rust-installer/gen-installer.sh: 15: ../rust3/build/host/stage2-tools-bin/cargo: not found

TEST FAILED!
```
2023-04-16 06:55:22 +09:00
Yuki Okushi
724da5cf11
Rollup merge of #110350 - SparkyPotato:test-79605, r=cjgillot
Add a UI test for #79605

#79605 was fixed somewhere between December 2020 and now, but it did not have a UI test.

This PR adds a UI test for the error.
2023-04-16 06:55:22 +09:00
Yuki Okushi
1c228d122f
Rollup merge of #110347 - est31:size_of_links, r=jyn514
Add intra-doc links to size_of_* functions

Also some smaller doc improvements.
2023-04-16 06:55:22 +09:00
Yuki Okushi
a484f22078
Rollup merge of #110307 - est31:beta_nominated_unauthenticated, r=Mark-Simulacrum
Allow everyone to set the beta-nominated label

It is allowed both in cargo and clippy's triagebot.toml, and nomination does not automatically mean that the PR will be backported.
2023-04-16 06:55:21 +09:00
Yuki Okushi
52d23c9253
Rollup merge of #110272 - Ezrashaw:fix-unconned-lt-in-implbounds, r=aliemjay
fix: skip implied bounds if unconstrained lifetime exists

Fixes #110161

r? ````@aliemjay````
2023-04-16 06:55:21 +09:00
Yuki Okushi
7e6983e27d
Rollup merge of #110033 - cuviper:relnotes-1.69.0, r=pietroalbini
Add 1.69.0 release notes

cc ````@rust-lang/release````
r? ````@Mark-Simulacrum````
2023-04-16 06:55:20 +09:00
Alona Enraght-Moony
266ec68d3d Convert comment to doc comment on Interner::get. 2023-04-15 21:50:57 +00:00
bors
50b816f71f Auto merge of #110319 - ferrocene:pa-more-ignore-reasons, r=ehuss
[compiletest] Add more test ignore reasons, `needs-` validation, and improved error messages

This PR makes more improvements to the way compiletest ignoring headers are handled, following up on #108905:

* Human-readable ignore reasons have been added for the remaining ignore causes (`needs-*` directives, `*llvm*` directives, and debugger version directives). All ignored tests should now have a human-readable reason.
* The code handling `needs-*` directives has been refactored, and now invalid `needs-*` directive emit errors like `ignore-*` and `only-*`.
* All errors are now displayed at startup (with line numbers) rather than just the first error of the first file.

This PR is best reviewed commit-by-commit.

r? `@ehuss`
2023-04-15 21:43:36 +00:00
Eric Huss
d7ed5a52ff Unignore closure-bang.
This test was ignored long ago in
https://github.com/rust-lang/rust/pull/20578/ when the syntax for
closures was changed.

The current status is that a closure with an explicit `!` return type
will trigger the `unreachable_code` lint which appears to be the
original intent of the test
(https://github.com/rust-lang/rust/pull/16836). A closure without a
return type won't trigger the lint since the `!` type isn't inferred
(AFAIK). This restores the test to its original form.
2023-04-15 14:43:20 -07:00
Michael Howell
0c61f58c11 rustdoc: stop passing a title to replaceState second argument
As described on [MDN's replaceState page], this parameter is not
currently used, and the empty string is "safe against future
changes to the method."

[MDN's replaceState page]: https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState
2023-04-15 13:15:48 -07:00
bors
5cdb7886a5 Auto merge of #110361 - ehuss:disable-jobserver-error, r=Mark-Simulacrum
Temporarily disable the jobserver-error test

This test is failing randomly on CI. We don't have a handle on what might be causing it, so disable it for now to reduce disruption.

cc https://github.com/rust-lang/rust/issues/110321
2023-04-15 19:26:41 +00:00
Matthias Krüger
bcd79c222a fix clippy::{clone_on_copy, useless_conversion} 2023-04-15 19:02:26 +02:00
Matthias Krüger
d666f6bf22 fix clippy::{filter_map_identiy, map_identity, manual_flatten} 2023-04-15 18:56:25 +02:00
Matthias Krüger
1077d574cf remove redundant clones 2023-04-15 18:04:51 +02:00
bors
fd57c6b407 Auto merge of #110227 - klensy:bs-win, r=Mark-Simulacrum
bootstrap: drop some windows features

They became unused after https://github.com/rust-lang/rust/pull/109960
2023-04-15 15:11:41 +00:00
Eric Huss
79b3af3f62 Temporarily disable the jobserver-error test 2023-04-15 07:40:19 -07:00
jyn
b1feb45f59 Fix x test rust-installer when cargo is set to a relative path
Previously, this would give an error because the shell script had a
different working directory:

```
test: basic_install
$ sh /home/jyn/src/rust/src/tools/rust-installer/gen-installer.sh --image-dir=/home/jyn/src/rust/src/tools/rust-installer/test/image1 --work-dir=/home/jyn/src/rust/build/x86_64-unknown-linux-gnu/test/rust-installer/workdir --output-dir=/home/jyn/src/rust/build/x86_64-unknown-linux-gnu/test/rust-installer/outdir
/home/jyn/src/rust/src/tools/rust-installer/gen-installer.sh: 15: ../rust3/build/host/stage2-tools-bin/cargo: not found

TEST FAILED!
```
2023-04-15 08:19:00 -05:00
Ali MJ Al-Nasrawy
4c80f58d41
Update compiler/rustc_trait_selection/src/traits/outlives_bounds.rs 2023-04-15 15:41:42 +03:00
bors
2816486986 Auto merge of #110349 - rust-lang:pa-bump-1.71.0, r=pietroalbini
Bump to Rust 1.71.0
2023-04-15 12:39:41 +00:00
est31
504a47b16d Add intra-doc links to size_of_* functions 2023-04-15 14:07:18 +02:00
SparkyPotato
714c276b9c add UI test for #79605 2023-04-15 17:17:46 +05:30
Pietro Albini
578aedd274
bump to rust 1.71.0 2023-04-15 12:29:51 +02:00
bors
ce1073ba9d Auto merge of #110323 - lcnr:dropck-uwu, r=compiler-errors
explicit `adt_dtorck_constraint` for `ManuallyDrop`

the only reason we didn't add outlives requirements when dropping `ManuallyDrop` was a fast-path in `trivial_dropck_outlives`. Explicitly acknowledge that fast-path in `adt_dtorck_constraint`
2023-04-15 10:21:55 +00:00
bors
67e273ba0e Auto merge of #109900 - cjgillot:disable-const-prop, r=oli-obk
Only enable ConstProp at mir-opt-level >= 2.

That pass is not responsible for lints any more, so we can restrict it to optimized builds.

This reduces the amount of duplicated const-eval messages.
2023-04-15 07:58:57 +00:00
Camille GILLOT
483525eed3 Remove obsolete test. 2023-04-15 07:46:47 +00:00
Camille GILLOT
c9409136c7 Bless run-make. 2023-04-15 07:46:47 +00:00
Camille GILLOT
4a1ff5e04d Bless codegen test. 2023-04-15 07:46:46 +00:00
Camille GILLOT
9ec086709e Remove outdated comment. 2023-04-15 07:46:46 +00:00
Camille GILLOT
22bf5fd848 Remove useless methods in visit. 2023-04-15 07:46:46 +00:00
Camille GILLOT
8a515aab76 Only enable ConstProp at mir-opt-level >= 2. 2023-04-15 07:46:46 +00:00
bors
825c70658e Auto merge of #110335 - asomers:rust-gdb-freebsd, r=jyn514
Fix rust-gdb on FreeBSD

"\w" is a GNU-specific extension to sed.  Avoid it.

Fixes #110334
Signed-off-by: Alan Somers <asomers@gmail.com>
2023-04-15 05:48:36 +00:00
bors
3312a3053b Auto merge of #109802 - notriddle:notriddle/rustdoc-search-generics-nested, r=GuillaumeGomez
rustdoc-search: add support for nested generics

This change allows `search.js` to parse nested generics (which look `Like<This<Example>>`) and match them. It maintains the existing "bag semantics", so that the order of type parameters is ignored but the number is required to be greater than or equal to what's in the query.

For example, a function with the signature `fn read_all(&mut self: impl Read) -> Result<Vec<u8>, Error>` will match these queries:

* `Read -> Result<Vec<u8>, Error>`
* `Read -> Result<Error, Vec>`
* `Read -> Result<Vec<u8>>`

But it *does not* match `Result<Vec, u8>` or `Result<u8<Vec>>`.
2023-04-15 02:23:32 +00:00
Alan Somers
c6b1f31449
Typo fix in src/etc/rust-gdb
Co-authored-by: SNCPlay42 <SNCPlay42@gmail.com>
2023-04-14 19:07:13 -07:00
bors
fef27e038e Auto merge of #110142 - Mark-Simulacrum:reduce-core-counts, r=pietroalbini
Reduce core counts for a number of builders

Best reviewed by-commit; first commit renames all builder names to include core counts.

Applied changes for these builders (only on the auto branch, haven't touched PR CI):

- arm-android -> 8 core (currently at 39 minutes; 25.58% CPU)
- armhf-gnu -> 8 core (currently at 31 minutes; 30.97% CPU)
- dist-aarch64-linux -> 8 core (currently at 35 minutes; 55.38% CPU)
- dist-android -> 8 core (currently at 18 minutes; 43.03% CPU)
- dist-armhf-linux -> 8 core (currently at 27 minutes; 54.71% CPU)
- dist-armv7-linux -> 8 core (currently at 29 minutes; 50.33% CPU)
- dist-i586-gnu-i586-i686-musl -> 8 core (currently at 27 minutes; 48.31% CPU)
- dist-i686-linux -> 8 core (currently at 32 minutes; 52.39% CPU)
- dist-mips-linux -> 8 core (currently at 25 minutes; 55.09% CPU)
- dist-mips64-linux -> 8 core (currently at 25 minutes; 55.33% CPU)
- dist-mips64el-linux -> 8 core (currently at 26 minutes; 54.93% CPU)
- dist-mipsel-linux -> 8 core (currently at 25 minutes; 55.38% CPU)
- dist-powerpc-linux -> 8 core (currently at 26 minutes; 55.77% CPU)
- dist-powerpc64-linux -> 8 core (currently at 27 minutes; 55.03% CPU)
- dist-powerpc64le-linux -> 8 core (currently at 27 minutes; 54.95% CPU)
- dist-riscv64-linux -> 8 core (currently at 26 minutes; 54.43% CPU)
- dist-s390x-linux -> 8 core (currently at 30 minutes; 55.97% CPU)
- dist-various-1 -> 8 core (currently at 36 minutes; 29.16% CPU)
- dist-various-2 -> 8 core (currently at 27 minutes; 32.69% CPU)
- dist-x86_64-freebsd -> 8 core (currently at 27 minutes; 51.69% CPU)
- dist-x86_64-illumos -> 8 core (currently at 30 minutes; 54.88% CPU)
- dist-x86_64-musl -> 8 core (currently at 39 minutes; 57.56% CPU)
- dist-x86_64-netbsd -> 8 core (currently at 26 minutes; 55.82% CPU)
- mingw-check -> 8 core (currently at 17 minutes; 35.00% CPU)
- test-various -> 8 core (currently at 22 minutes; 44.84% CPU)
- wasm32 -> 8 core (currently at 19 minutes; 62.94% CPU)
- x86_64-gnu -> 8 core (currently at 32 minutes; 50.31% CPU)
- x86_64-gnu-stable -> 8 core (currently at 32 minutes; 51.23% CPU)
- x86_64-gnu-aux -> 8 core (currently at 22 minutes; 46.39% CPU)
- x86_64-gnu-debug -> 8 core (currently at 21 minutes; 53.93% CPU)
- x86_64-gnu-distcheck -> 8 core (currently at 38 minutes; 55.93% CPU)
- x86_64-gnu-llvm-15 -> 8 core (currently at 34 minutes; 52.99% CPU)
- x86_64-gnu-llvm-14 -> 8 core (currently at 34 minutes; 52.09% CPU)
- x86_64-gnu-llvm-14-stage1 -> 8 core (currently at 33 minutes; 51.13% CPU)
- x86_64-gnu-nopt -> 8 core (currently at 29 minutes; 53.36% CPU)
- x86_64-gnu-tools -> 8 core (currently at 22 minutes; 40.56% CPU)

We may also want to look at merging some of these builders in the future (to deduplicate stage0 builds and such) but that can happen separately - and is more work than just adjusting core counts.

r? `@pietroalbini`
2023-04-15 00:08:07 +00:00
Alan Somers
2f45d197f3 Fix rust-gdb and rust-gdbgui on FreeBSD
"\w" is a GNU-specific extension to sed.  Avoid it.

Fixes #110334
Signed-off-by: Alan Somers <asomers@gmail.com>
2023-04-14 18:06:26 -06:00
Michael Howell
6ce53278e1 Update how-to-read-rustdoc.md 2023-04-14 14:55:45 -07:00