| Age | Commit message (Collapse) | Author | Lines |
|
|
|
I believe rustdoc should not be conflating private items (visibility
lower than `pub`) and hidden items (attribute `doc(hidden)`). This
matters now that Cargo is passing --document-private-items by default
for bin crates. In bin crates that rely on macros, intentionally hidden
implementation details of the macros can overwhelm the actual useful
internal API that one would want to document.
This PR restores the strip-hidden pass when documenting private items,
and introduces a separate unstable --document-hidden-items option to
skip the strip-hidden pass. The two options are orthogonal to one
another.
|
|
(cherry picked from commit f6e9fd037a7b55f8f4fe78694b77d9788b18dfeb)
|
|
Use `shrink_to_hi` instead of `next_point`
Fix #68000.
(cherry picked from commit fcd850fc5db2501d14b2e0cbfac8aa890d700e55)
|
|
(cherry picked from commit 915db7ae6430baef99f186ba40f08e105b7694fe)
|
|
|
|
representation
|
|
|
|
|
|
|
|
PR https://github.com/rust-lang/rust/pull/66512 added the ability to set argv[0] on
Command. As a side effect, it changed the Debug output to print both the program and
argv[0], which in practice results in stuttery output ("echo echo foo").
This PR reverts the behaviour to the the old one, so that the command is only printed
once - unless arg0 has been set. In that case it emits "[command] arg0 arg1 ...".
|
|
Do not ICE on unnamed future
Fix #67252.
|
|
Enable `loop` and `while` in constants behind a feature flag
This PR is an initial implementation of #52000. It adds a `const_loop` feature gate, which allows `while` and `loop` expressions through both HIR and MIR const-checkers if enabled. `for` expressions remain forbidden by the HIR const-checker, since they desugar to a call to `IntoIterator::into_iter`, which will be rejected anyways.
`while` loops also require [`#![feature(const_if_match)]`](https://github.com/rust-lang/rust/pull/66507), since they have a conditional built into them. The diagnostics from the HIR const checker will suggest this to the user.
r? @oli-obk
cc @rust-lang/wg-const-eval
|
|
|
|
r=centril
Revert stabilization of never type
Fixes https://github.com/rust-lang/rust/issues/66757
I decided to keep the separate `never-type-fallback` feature gate, but tried to otherwise revert https://github.com/rust-lang/rust/pull/65355. Seemed pretty clean.
( cc @Centril, author of #65355, you may want to check this over briefly )
|
|
|
|
|
|
|
|
This reverts commit 8f6197f39f7d468dfc5b2bd41dae4769992a2f83.
|
|
Require stable/unstable annotations for the constness of all stable fns with a const modifier
r? @RalfJung @Centril
Every `#[stable]` const fn now needs either a `#[rustc_const_unstable]` attribute or a `#[rustc_const_stable]` attribute. You can't silently stabilize the constness of a function anymore.
|
|
Point at method call when type annotations are needed
- Point at method call instead of whole expression when type annotations are needed.
- Suggest use of turbofish on function and methods.
Fix #49391, fix #46333, fix #48089. CC #58517, #63502, #63082.
Fixes https://github.com/rust-lang/rust/issues/40015
r? @nikomatsakis
|
|
`coerce_inner`: use initial `expected_ty`
Fixes #67273.
Follow-up to #59439.
r? @oli-obk
|
|
r=varkor,Centril,estebank
Improve diagnostics and code for exhaustiveness of empty matches
There was a completely separate check and diagnostics for the case of an empty match. This led to slightly different error messages and duplicated code.
This improves code reuse and generally clarifies what happens for empty matches. This also clarifies the action of the `exhaustive_patterns` feature, and ensures that this feature doesn't change diagnostics in places it doesn't need to.
|
|
|
|
|
|
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
functions with a `const` modifier
|
|
|
|
parser: recover on `&'lifetime mut? $pat`.
r? @estebank
|
|
Require `allow_internal_unstable` for stable min_const_fn using unsta…
…ble features
r? @Centril
cc @ecstatic-morse @RalfJung
|
|
Don't suggest wrong snippet in closure
Fixes #67190
r? @estebank
|
|
|
|
features
|
|
|
|
Rollup of 8 pull requests
Successful merges:
- #62514 (Clarify `Box<T>` representation and its use in FFI)
- #66983 (Fix `unused_parens` triggers on macro by example code)
- #67215 (Fix `-Z print-type-sizes`'s handling of zero-sized fields.)
- #67230 (Remove irelevant comment on `register_dtor`)
- #67236 (resolve: Always resolve visibilities on impl items)
- #67237 (Some small readability improvements)
- #67238 (Small std::borrow::Cow improvements)
- #67239 (Make TinyList::remove iterate instead of recurse)
Failed merges:
r? @ghost
|
|
|
|
resolve: Always resolve visibilities on impl items
Fixes https://github.com/rust-lang/rust/issues/64705.
Similarly to https://github.com/rust-lang/rust/pull/67106 this was an issue with visitor discipline.
Impl items were visited as a part of visiting `ast::ItemKind::Impl`, but they should be visit-able in isolation from their parents as well, because that's how they are visited when they are expanded from macros.
I've checked that all the remaining `resolve_visibility` calls are used correctly.
r? @matthewjasper
|
|
r=pnkfelix
Fix `-Z print-type-sizes`'s handling of zero-sized fields.
Currently, the type `struct S { x: u32, y: u32, tag: () }` is
incorrectly described like this:
```
print-type-size type: `S`: 8 bytes, alignment: 4 bytes
print-type-size field `.x`: 4 bytes
print-type-size field `.tag`: 0 bytes, offset: 0 bytes, alignment: 1 bytes
print-type-size padding: 4 bytes
print-type-size field `.y`: 4 bytes, alignment: 4 bytes
```
Specifically:
- The `padding` line is wrong. (There is no padding.)
- The `offset` and `alignment` on the `.tag` line shouldn't be printed.
The problem is that multiple fields can end up with the same offset, and
the printing code doesn't handle this correctly.
This commit fixes it by adjusting the field sorting so that zero-sized fields
are dealt with before non-zero-sized fields. With that in place, the
printing code works correctly.
The commit also corrects the "something is very wrong" comment.
The new output looks like this:
```
print-type-size type: `S`: 8 bytes, alignment: 4 bytes
print-type-size field `.tag`: 0 bytes
print-type-size field `.x`: 4 bytes
print-type-size field `.y`: 4 bytes
```
r? @pnkfelix
|
|
Fix `unused_parens` triggers on macro by example code
Fix #66295
Unfortunately this does also break [an existing test](https://github.com/rust-lang/rust/blob/4787e97475de6be9487e3d9255a9c2d3c0bf9252/src/test/ui/lint/issue-47775-nested-macro-unnecessary-parens-arg.rs#L22). I'm not sure how to handle that, because that seems to be quite similar to the allowed cases
If this gets accepted it would be great to backport this fix to beta.
|
|
Remove uniform array move MIR passes
This PR fixes a number of bugs caused by limitations of this pass
* Projections from constant indexes weren't being canonicalized
* Constant indexes from the start weren't being canonicalized (they could have different min_lengths)
* It didn't apply to non-moves
This PR makes the following changes to support removing this pass:
* ConstantIndex of arrays are now generated in a canonical form (from the start, min_length is the actual length).
* Subslices are now split when generating move paths and when checking subslices have been moved.
Additionally
* The parent move path of a projection from an array element is now calculated correctly
closes #66502
|
|
davidtwco:issue-64130-async-send-sync-error-improvements, r=nikomatsakis
async/await: improve not-send errors, part 2
Part of #64130. Fixes #65667.
This PR improves the errors introduced in #64895 so that they have specialized messages for `Send` and `Sync`.
r? @nikomatsakis
|
|
|
|
|
|
rustc: allow non-empty ParamEnv's in global trait select/eval caches.
*Based on #66963*
This appears to alleviate the symptoms of #65510 locally (without fixing WF directly), and is potentially easier to validate as sound (since it's a more ad-hoc version of queries we already have).
I'm opening this PR primarily to test the effects on perf.
r? @nikomatsakis cc @rust-lang/wg-traits
|