Clean up pr 104954
UI test filename typo fix and a simple comment rewording. Thanks.
CC `@vincenzopalazzo` (you spelled your name wrongly in the FIXME)
r? `@estebank`
Revert #104269 (to avoid spurious hang/test failure in CI)
Causes hangs/memory overflows in the test suite apparently 😢Reopens#104225Fixes#104957
r? ``@lcnr``
`mk_const(ty::ConstKind::X(...), ty)` can now be simplified to
`mk_cosnt(..., ty)`.
I searched with the following regex: \mk_const\([\n\s]*(ty::)?ConstKind\
I've left `ty::ConstKind::{Bound, Error}` as-is, they seem clearer this
way.
- Accept `impl Into`
- Implement `From<>` for `ConstKind`
Note: this adds a dependency on `derive_more` (MIT license). It allows
to derive a lot of traits (like `From` here) that would be otherwise
tedious to implement.
stricter alignment enforcement for ScalarPair
`@eddyb` [indicated](https://github.com/rust-lang/rust/pull/103926#discussion_r1033315005) that alignment violating this check might be a bug. So let's see what the test suite says.
(Only the 2nd commit actually changes behavior... but I couldn't not do that other cleanup.^^)
Does the PR CI runner even enable debug assertions though...?
make simple check of prinf function
Fixes https://github.com/rust-lang/rust/issues/92898
With this commit we start to make some simple
check when the name resolution fails, and
we generate some helper messages in case the
name is a C name like in the case of the `printf`
and suggest the correct rust method.
`@rustbot` r? `@pnkfelix`
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Ignore bivariant parameters in test_type_match.
https://github.com/rust-lang/rust/pull/103491 made opaque types bivariant with respect of some of their lifetime parameters. Because of this bivariance, some lifetime variables were not unified to anything during borrowck, and were considered as unequal by borrowck type test.
This PR makes type test ignore the bivariant parameters in test_type_match.
Fixes https://github.com/rust-lang/rust/issues/104815
r? `@oli-obk`
Add documentation for `has_escaping_bound_vars`
Thanks to `@BoxyUwU` for explaining this to me. Adding docs with a helpful link if people get confused.
Remove `SelectionContext::infcx()` in favor of field access
Encapsulation doesn't seem particularly important here, and having two choices is always more confusing than having one.
r? types
Change multiline span ASCII art visual order
Tweak the ASCII art for nested multiline spans so that we minimize line overlaps.
Partially addresses https://github.com/rust-lang/rust/issues/61017.
`Lit::from_included_bytes` calls `Lit::from_lit_kind`, but the two call
sites only need the resulting `token::Lit`, not the full `ast::Lit`.
This commit changes those call sites to use `LitKind::to_token_lit`,
which means `from_included_bytes` can be removed.
Prefer doc comments over `//`-comments in compiler
Doc comments are generally nicer: they show up in the documentation, they are shown in IDEs when you hover other mentions of items, etc. Thus it makes sense to use them instead of `//`-comments.
Rollup of 8 pull requests
Successful merges:
- #95836 (Use `rust_out{exe_suffix}` for doctests)
- #104882 (notify lcnr on changes to `ObligationCtxt`)
- #104892 (Explain how to get the discriminant out of a `#[repr(T)] enum` with payload)
- #104917 (Allow non-org members to label `requires-debug-assertions`)
- #104931 (Pretty-print generators with their `generator_kind`)
- #104934 (Remove redundant `all` in cfg)
- #104944 (Support unit tests for jsondoclint)
- #104946 (rustdoc: improve popover focus handling JS)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Remove redundant `all` in cfg
This appears to have been accidentally left in after removing the other branches 45bf1ed1a1
(hat tip to kangalioo for the git archaeology)
Pretty-print generators with their `generator_kind`
After removing `GenFuture`, I special-cased async generators to pretty-print as `impl Future<Output = X>` mainly to avoid too much diagnostics changes originally.
This now reverses that change so that async fn/blocks are pretty-printed as `[$async-type@$source-position]` in various diagnostics, and updates the tests that this touches.
Separate lifetime ident from lifetime resolution in HIR
Drive-by: change how suggested generic args are computed.
Fixes https://github.com/rust-lang/rust/issues/103815
I recommend reviewing commit-by-commit.
With this commit we start to make some simple
check when the name resolution fails, and
we generate some helper message in case the
name is a C name like in the case of the `printf`
and suggest the correct rust method.
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>