Commit Graph

167323 Commits

Author SHA1 Message Date
Christian Poveda
e7ae9eb3f2
rename sum_with_parens 2022-04-27 12:03:16 +02:00
Ellen
f697955c1e tut tut tut 2022-04-27 08:51:33 +01:00
Michael Goulet
83d701e569 Better error messages when collecting into [T; n] 2022-04-26 21:37:10 -07:00
bors
bb85bcaca9 Auto merge of #96195 - sunfishcode:sunfishcode/handle-or-error-type, r=joshtriplett
Define a dedicated error type for `HandleOrNull` and `HandleOrInvalid`.

Define `NullHandleError` and `InvalidHandleError` types, that implement std::error::Error, and use them as the error types in `HandleOrNull` and `HandleOrInvalid`,

This addresses [this concern](https://github.com/rust-lang/rust/issues/87074#issuecomment-1080031167).

This is the same as #95387.

r? `@joshtriplett`
2022-04-27 03:42:59 +00:00
Caio
b72f6e55a1 Move some tests to more reasonable places 2022-04-26 23:38:04 -03:00
Michael Goulet
f9e7489f87 TAITs are suggestable 2022-04-26 18:55:55 -07:00
Michael Goulet
ae42f22ba0 make fn() -> _ {} suggestion MachineApplicable 2022-04-26 18:50:46 -07:00
bors
99b70ee230 Auto merge of #96459 - Dylan-DPC:rollup-de6ud9d, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #92569 (Improve Error Messaging for Unconstructed Structs and Enum Variants in Generic Contexts)
 - #96370 (Cleanup `report_method_error` a bit)
 - #96383 (Fix erased region escaping into wfcheck due to #95395)
 - #96385 (Recover most `impl Trait` and `dyn Trait` lifetime bound suggestions under NLL)
 - #96410 (rustdoc: do not write `{{root}}` in `pub use ::foo` docs)
 - #96430 (Fix handling of `!` in rustdoc search)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-04-27 01:01:58 +00:00
Dylan DPC
c0ed53c0da
Rollup merge of #96430 - GuillaumeGomez:search-exclamation, r=notriddle
Fix handling of `!` in rustdoc search

Fixes #96399.

I also updated the eBNF.

cc `@jsha`
r? `@notriddle`
2022-04-27 02:47:12 +02:00
Dylan DPC
875b22ff30
Rollup merge of #96410 - notriddle:notriddle/issue-95873, r=GuillaumeGomez
rustdoc: do not write `{{root}}` in `pub use ::foo` docs

Fixes #95873
2022-04-27 02:47:11 +02:00
Dylan DPC
dc1f98c655
Rollup merge of #96385 - marmeladema:nll-fix-trait-lifetime-bound-suggestions, r=jackh726
Recover most `impl Trait` and `dyn Trait` lifetime bound suggestions under NLL

This is done by replacing the duplicated (and very partial) implementation from borrowck with one inspsired from `NiceRegionError::try_report_static_impl_trait` and by re-using `suggest_new_region_bound`.

Fixes #96277

r? ```@jackh726```
2022-04-27 02:47:11 +02:00
Dylan DPC
5645732b04
Rollup merge of #96383 - compiler-errors:issue-96381, r=estebank
Fix erased region escaping into wfcheck due to #95395

We can just use `liberate_late_bound_regions` instead of `erase_late_bound_regions`... This gives us `ReEarlyBound` instead of `ReErased`, the former being something typeck actually knows how to deal with...

Fixes #96381

Side-note: We only actually get far enough in the compiler pipeline to cause this ICE when we're invoking rustdoc. We actually abort rustc right before wfcheck because of the error that we emit (having `_` in the type signature). Why does rustdoc keep going even though we raise an error?
2022-04-27 02:47:10 +02:00
Dylan DPC
e63da0ba00
Rollup merge of #96370 - compiler-errors:cleanup-report_method_error, r=estebank
Cleanup `report_method_error` a bit

1. Remove an unnecessary indentation level
2. Split out a couple of large functions from this humongo function body
2022-04-27 02:47:07 +02:00
Dylan DPC
ac46e17c02
Rollup merge of #92569 - George-lewis:87181, r=estebank
Improve Error Messaging for Unconstructed Structs and Enum Variants in Generic Contexts

Improves error messaging for empty-tuple structs and enum variants in certain generic contexts. See new ui tests for examples.

Closes #87181
2022-04-27 02:47:07 +02:00
Nicholas Nethercote
86f011704c Make explicit an unreachable NoDelim case in rustfmt. 2022-04-27 10:35:33 +10:00
Nicholas Nethercote
9665da35cc Avoid producing NoDelim values in FrameData. 2022-04-27 10:35:29 +10:00
bors
a7197189cd Auto merge of #96425 - oli-obk:fix_incremental_regression_unsafety_checking, r=compiler-errors
Fix incremental perf regression unsafety checking

Perf regression introduced in #96294

We will simply avoid emitting the name of the unsafe function in MIR unsafeck, since we're moving to THIR unsafeck anyway.
2022-04-26 22:35:40 +00:00
Nicholas Nethercote
a8e862cb7d Avoid producing NoDelim values in Frame.
The code currently ignores the actual delimiter on the RHS and fakes up
a `NoDelim`/`DelimSpan::dummy()` one. This commit changes it to use the
actual delimiter.

The commit also reorders the fields for the `Delimited` variant to match
the `Sequence` variant.
2022-04-27 08:25:22 +10:00
Nicholas Nethercote
6b367a0532 Avoid producing NoDelim values in MacArgs::delim(). 2022-04-27 08:15:12 +10:00
Nicholas Nethercote
f0bbc782ac Avoid producing NoDelim values in TokenCursorFrame. 2022-04-27 08:15:05 +10:00
George
a6b570b209 Tidy 2022-04-26 17:05:49 -04:00
George
14a127be3e Add new diagnostic 2022-04-26 17:04:44 -04:00
Vadim Petrochenkov
4136b8feb0 linker: Generate symbols.o for dylibs 2022-04-26 23:16:08 +03:00
Vadim Petrochenkov
73317f8b0d linker: Stop using whole-archive on dependencies of dylibs
https://github.com/rust-lang/rust/pull/95604 implemented a better and more fine-grained way of keeping exported symbols alive.
2022-04-26 23:16:07 +03:00
Dan Gohman
531c9373be Fix the filename in the expected error message. 2022-04-26 12:47:24 -07:00
Guillaume Gomez
4e0be6ddeb Remove dead code in main.js 2022-04-26 20:59:33 +02:00
Guillaume Gomez
509b145744 Migrate scrape-examples.js to ES6 2022-04-26 20:59:33 +02:00
Guillaume Gomez
724c4bd9bb Migrate storage.js to ES6 2022-04-26 20:59:32 +02:00
Guillaume Gomez
6faa40d406 Migrate source-script to ES6 2022-04-26 20:59:32 +02:00
Guillaume Gomez
016334a3ad Migrate main.js to ES6 2022-04-26 20:59:32 +02:00
Guillaume Gomez
cb8da88c83 Migrate externs.js to ES6 2022-04-26 20:59:32 +02:00
Guillaume Gomez
ae93e6e3b8 Small JS code improvements 2022-04-26 20:59:32 +02:00
Guillaume Gomez
4ea149905b Update rustdoc search test to check ! 2022-04-26 20:57:46 +02:00
Guillaume Gomez
45cdb2be10 Update rustdoc search parser to handle ! correctly 2022-04-26 20:57:45 +02:00
Dan Gohman
839cd04cc4 Add only-windows versions of the coerce-issue-49593-box-never test. 2022-04-26 09:52:22 -07:00
b-naber
bfefb4d74c account for custom DSTs in valtree -> constvalue conversion 2022-04-26 18:40:15 +02:00
bors
082e4ca497 Auto merge of #96428 - GuillaumeGomez:rollup-4noqr33, r=GuillaumeGomez
Rollup of 8 pull requests

Successful merges:

 - #94022 (Clarify that `Cow::into_owned` returns owned data)
 - #94703 (Fix codegen bug in "ptx-kernel" abi related to arg passing)
 - #95949 (Implement Default for AssertUnwindSafe)
 - #96361 (Switch JS code to ES6)
 - #96372 (Suggest calling method on nested field when struct is missing method)
 - #96386 (simplify `describe_field` func in borrowck's diagnostics part)
 - #96400 (Correct documentation for `Rvalue::ShallowInitBox`)
 - #96415 (Remove references to git.io)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-04-26 15:59:46 +00:00
Chris Denton
949b978ec9
Windows: Make stdin pipes synchronous
Stdin pipes do not need to be used asynchronously within the standard library.
2022-04-26 16:31:27 +01:00
Chris Denton
b89b056742
Add set_inheritable for Windows Handles 2022-04-26 15:56:26 +01:00
Oli Scherer
3568bdc6cd Revert "add DefId to unsafety violations and display function path in E0133"
This reverts commit 8b8f6653cf.
2022-04-26 14:49:28 +00:00
Michael Howell
c2a9a68581
Update src/test/rustdoc/issue-95873.rs
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2022-04-26 07:13:30 -07:00
SparrowLii
843e8d19ec not need Option for dbg_scope 2022-04-26 21:00:19 +08:00
Guillaume Gomez
223f107b48
Rollup merge of #96415 - ehuss:git-io, r=bjorn3
Remove references to git.io

The git.io service is shutting down soon (see https://github.blog/changelog/2022-04-25-git-io-deprecation/). This removes the references of those short links with the actual destination.
2022-04-26 13:22:31 +02:00
Guillaume Gomez
f908391136
Rollup merge of #96400 - JakobDegen:shallow-init-docs, r=Dylan-DPC
Correct documentation for `Rvalue::ShallowInitBox`

As a part of the big MIR docs PR, I had added a comment indicating that `Rvalue::ShallowInitBox` is disallowed after drop elaboration, but this is not true (no idea why I thought it was). Codegen has support for it, and trying to enforce this rule in the validator causes compiling core to ICE on the very first `box` statement.

That being said, this `Rvalue` probably *should* be banned after drop elaboration - it doesn't seem like it's still useful for much. However, I do not have time right now to actually go investigate how difficult a change that is to make, so in the meantime fixing the docs to reflect the current situation seems like the right step.

r? rust-lang/mir-opt
2022-04-26 13:22:30 +02:00
Guillaume Gomez
a818173e63
Rollup merge of #96386 - SparrowLii:des_field, r=jackh726
simplify `describe_field` func in borrowck's diagnostics part

This PR simplify the `describe_field` func in borrowck's diagnostics part, besides fix the FIXME in it.
2022-04-26 13:22:29 +02:00
Guillaume Gomez
bb6265a739
Rollup merge of #96372 - compiler-errors:field-method-suggest, r=oli-obk
Suggest calling method on nested field when struct is missing method

Similar to the suggestion to change `x.field` to `x.nested.field`, implement a similar suggestion for when `x.method()` should be replaced with `x.nested.method()`.
2022-04-26 13:22:29 +02:00
Guillaume Gomez
52fefb0454
Rollup merge of #96361 - GuillaumeGomez:es6, r=notriddle
Switch JS code to ES6

Considering it's already quite big, I'll do the remaining files in another PR.

Part of #93058.

r? ``@notriddle``
2022-04-26 13:22:28 +02:00
Guillaume Gomez
2b8bf0d530
Rollup merge of #95949 - SoniEx2:patch-5, r=m-ou-se
Implement Default for AssertUnwindSafe

Trait impls are still insta-stable yeah...?
2022-04-26 13:22:27 +02:00
Guillaume Gomez
fe49981ea0
Rollup merge of #94703 - kjetilkjeka:nvptx-kernel-args-abi2, r=nagisa
Fix codegen bug in "ptx-kernel" abi related to arg passing

I found a codegen bug in the nvptx abi related to that args are passed as ptrs ([see comment](https://github.com/rust-lang/rust/issues/38788#issuecomment-1048999928)), this is not as specified in the [ptx-interoperability doc](https://docs.nvidia.com/cuda/ptx-writers-guide-to-interoperability/) or how C/C++ does it. It will also almost always fail in practice since device/host uses different memory spaces for most hardware.

This PR fixes the bug and add tests for passing structs to ptx kernels.

I observed that all nvptx assembly tests had been marked as [ignore a long time ago](https://github.com/rust-lang/rust/pull/59752#issuecomment-501713428). I'm not sure if the new one should be marked as ignore, it passed on my computer but it might fail if ptx-linker is missing on the server? I guess this is outside scope for this PR and should be looked at in a different issue/PR.

I only fixed the nvptx64-nvidia-cuda target and not the potential code paths for the non-existing 32bit target. Even though 32bit nvptx is not a supported target there are still some code under the hood supporting codegen for 32 bit ptx. I was advised to create an MCP to find out if this code should be removed or updated.

Perhaps ``@RDambrosio016`` would have interest in taking a quick look at this.
2022-04-26 13:22:27 +02:00
Guillaume Gomez
eaf8beb3f3
Rollup merge of #94022 - jongiddy:cow-into-owned-docs, r=Dylan-DPC
Clarify that `Cow::into_owned` returns owned data

Two sections of the `Cow::into_owned` docs imply that `into_owned` returns a `Cow`. Clarify that it returns the underlying owned object, either cloned or extracted from the `Cow`.
2022-04-26 13:22:26 +02:00