Remove a stack frame from .await calls
The stack frames when `.await`ing one async fn from another currently look like this:
```
12: foo:🅱️:{{closure}}
at src/main.rs:2
13: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
at /home/sfackler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/future/mod.rs:66
14: core::future::poll_with_context
at /home/sfackler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/future/mod.rs:84
15: foo:🅰️:{{closure}}
at src/main.rs:6
```
Since the move away from using TLS to pass the Context around, it's now easy to remove frame 14 by removing poll_with_context in favor of calling Future::poll directly. This still leaves the `GenFuture` frame, but that seems significantly harder to deal with.
It also improves diagnostics a bit since they no longer talk about the private poll_with_context function.
Rollup of 6 pull requests
Successful merges:
- #69903 (Do not ICE in the face of invalid enum discriminant)
- #70354 (Update RELEASES.md for 1.43.0)
- #70774 (End cleanup on rustdoc-js tools)
- #70990 (Improve rustdoc source code a bit)
- #71145 (Add illumos triple)
- #71166 (Clean up E0518 explanation)
Failed merges:
r? @ghost
Add illumos triple
This fixesrust-lang/rust#55553 and adds support for `illumos` as a `target_os` on `x86_64`. In addition to the compile spec and libstd additions, several library dependencies have been bumped in order to permit working builds of cargo and rustup for the new target.
Work originally started by @jasonbking, with subsequent additions by @pfmooney and @jclulow.
Improve rustdoc source code a bit
Very small clean up. I realized that there were too many nested conditions whereas we could just use `and_then`.
r? @kinnison
cc @ollie27
End cleanup on rustdoc-js tools
Fixes#70689.
It removes a lot of code, which is pretty nice. :3
We now only have one entry point and a small set of options.
r? @ollie27
submodules: update clippy from af5940b7 to d236b30a
Changes:
````
rustup https://github.com/rust-lang/rust/pull/70643
Explain panic on `E0463` in integration tests
Temporarily disable rustfmt integration test
Cleanup: Use rustc's is_proc_macro_attr
Cleanup: Use our `sym!` macro more
Fixes#5405: redundant clone false positive with arrays
update lints
verbose_bit_mask: fix bit mask used in docs
Update documentation for new_ret_no_self
````
Fixes#71114
Changes:
````
Rename dummy_hir_id -> parent_hir_id
rustup https://github.com/rust-lang/rust/pull/71116
Change default many single char names threshold
Better precedence case management + more tests
Use only check_expr with parent expr and precedence
Check for Deref trait impl + add fixed version
Report using stmts and expr + tests
Global rework + fix imports
Working basic dereference clip
Add test for zero single char names
Make the single char threshold strict inequality
large_enum_variant: Report sizes of variants
Refactor: Use rustc's `match_def_path`
deps: bump compiletest-rs from 0.4 to 0.5
rustup https://github.com/rust-lang/rust/pull/70643
Explain panic on `E0463` in integration tests
Temporarily disable rustfmt integration test
result_map_unit_fn: Fix incorrect UI tests
Cleanup: Use rustc's is_proc_macro_attr
Cleanup: Use our `sym!` macro more
Fixes#5405: redundant clone false positive with arrays
Disallow bit-shifting in `integer_arithmetic` lint
update lints
cargo dev fmt
Make use of Option/Result diagnostic items
Make use of some existing diagnostic items
Say that diagnostic items are preferred over paths
verbose_bit_mask: fix bit mask used in docs
Update documentation for new_ret_no_self
Update doc generation script
Add lint on large const arrays
Make the epsilon note spanless
Split check_fn function
Indicate when arrays are compared in error message
Make epsilon note spanless when comparing arrays
Add float cmp const tests for arrays
Add float cmp tests for arrays
Handle constant arrays with single value
Don't show comparison suggestion for arrays
Allow for const arrays of zeros
Handle evaluating constant index expression
Add handling of float arrays to miri_to_const
Update stderr of float_cmp test
Update field names in is_float
Add tests for float in array comparison
Add lint when comparing floats in an array
````
Fixes#71114
Entirely remove `DUMMY_HIR_ID`
Some helpers functions have been introduced to deal with (buggy) cases
where either a `NodeId` or a `DefId` do not have a corresponding `HirId`.
Those cases are tracked in issue #71104.
rustc_target: Refactor target specifications related to Windows and UEFI
- LLD support is improved.
- Code is cleaned up.
- Target specs are organized in a more hierarchical way.
- Possible issues in UWP and UEFI platforms are identified (see FIXMEs).
The code is better read per-commit.
Don't always run `add_call_guards` pass
It is only needed when `add_retag` runs.
(the pass is run again to split critical edges before codegen, that one is required)
The ioctl(FIONBIO) method of setting a file descriptor to be
non-blocking does not notify the underlying resource in the same way
that fcntl(F_SETFL, O_NONBLOCK) does on illumos and Solaris.
Rollup of 8 pull requests
Successful merges:
- #70657 (Allow `try`-blocks in places where an open delim is expected)
- #70947 (tighten CTFE safety net for accesses to globals)
- #70949 (simplify `vec!` macro)
- #71002 (fix target & runtool args order)
- #71082 (ptr: introduce len() method on raw slices)
- #71128 (Remove unused single_step flag)
- #71133 (Tighten time complexity on the doc of sort_by_key)
- #71135 (Update books)
Failed merges:
r? @ghost
Remove unused single_step flag
This appears to have never been used ever since its introduction in 61c7569d4 --
the plugin discussed on the PR introducing that commit, 34811, never
materialized.
It's also simple to re-add in the current scheme, but given that macro expansion
is already quite complicated, additional useless state seems good to remove
while we're not using it.
ptr: introduce len() method on raw slices
It is already possible to extract the pointer part of a raw slice by a
simple cast, but retrieving the length is not possible without relying
on the representation of the raw slice when it is not valid to convert
the raw slice into a slice reference (i.e. the pointer is null or
unaligned).
~Introduce a new function ptr::slice_len() to add this missing feature.~
Introduce a len() method on raw slices to add this missing feature.
fix target & runtool args order
- `TargetTripple::to_string` converts "path triples" to `<target>-<hash>`, but in this case we need the path. Afaict there is no method to get the real triple other than manually matching
- the order of the runtools arguments is inconsistent with the way tests usually pass arguments ie using `runner` key in `.cargo/config`
simplify `vec!` macro
Simplify `vec!` macro by replacing 2 following branches:
- `($($x:expr),*) => (...)`
- `($($x:expr,)*) => (...)`
with one:
- `($($x:expr),* $(,)?) => (...)`
This is a minor change, however, this will make the documentation cleaner
tighten CTFE safety net for accesses to globals
Previously, we only rejected reading from all statics. Now we also reject reading from any mutable global. Mutable globals are the true culprit here as their run-time value might be different from their compile-time values. Statics are just the approximation we use for that so far.
Also refactor the code a bit to make it clearer what is being checked and allowed.
r? @oli-obk
typeck: always expose repeat count `AnonConst`s' parent in `generics_of`.
This should reduce some of the confusion around #43408, although, if you look at the changed test outputs (for the last commit), they all hit #68436, so nothing new will start compiling.
We can let counts of "repeat expressions" (`N` in `[x; N]`) always have the correct generics parenting, because they're always in a body, so nothing in the `where` clauses or `impl` trait/type of the parent can use it, and therefore no query cycles can occur.
<hr/>
Other potential candidates we might want to apply the same approach to, are:
* ~~(easy) `enum` discriminants (see also #70453)~~ opened #70825
* (trickier) array *type* (not *expression*) lengths nested in:
* bodies
* types of (associated or not) `const`/`static`
* RHS of `type` aliases and associated `type`s
* `fn` signatures
We should've done so from the start, the only reason we haven't is because I was squeamish about blacklisting some of the cases, but if we whitelist instead we should be fine.
Also, lazy normalization is taking forever 😞.
<hr/>
There's also 5 other commits here:
* "typeck: track any errors injected during writeback and taint tables appropriately." - fixes#66706, as the next commit would otherwise trigger an ICE again
* "typeck: workaround WF hole in `to_const`." - its purpose is to emulate most of #70107's direct effect, at least in the case of repeat expressions, where the count always goes through `to_const`
* this is the reason no new code can really compile, as the WF checks require #68436 to bypass
* however, this has more test changes than I hoped, so it should be reviewed separately, and maybe even landed separately (as #70107 might take a while, as it's blocked on a few of my PRs)
* "ty: erase lifetimes early in `ty::Const::eval`." - first attempt at fixing #70773
* still useful, I believe the new approach is less likely to cause issues long-term
* I could take this out or move it into another PR if desired or someone else could take over (cc @skinny121)
* "traits/query/normalize: add some `debug!` logging for the result." - debugging aid for #70773
* "borrow_check/type_check: normalize `Aggregate` and `Call` operands." - actually fixes#70773
r? @nikomatsakis cc @pnkfelix @varkor @yodaldevoid @oli-obk @estebank