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
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 len() method on raw slices to add this missing feature.
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 readd 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.
Remove the last remnant of unsigned Neg
It's been gone since #23945, before Rust 1.0. The former wrapping
semantics have also been available as inherent methods for a long time
now. There's no reason to keep this unused macro around.
Improve async-await/generator obligation errors in some cases
Fixes#68112.
This change is best read one commit at a time (I add a test at the beginning and update it in each change after).
The `test2` function is a case I found while writing the test that we don't handle with this code yet. I don't attempt to fix it in this PR, but it's a good candidate for future work.
r? @davidtwco, @nikomatsakis
It's been gone since #23945, before Rust 1.0. The former wrapping
semantics have also been available as inherent methods for a long time
now. There's no reason to keep this unused macro around.
Rollup of 4 pull requests
Successful merges:
- #70654 (Explain how to work with subtree)
- #71092 (Remove some usage of `DUMMY_HIR_ID`)
- #71103 (Add test case for type aliasing `impl Sized`)
- #71109 (allow const generics in const fn)
Failed merges:
r? @ghost
allow const generics in const fn
This was explicitly forbidden before. As we were unable to think of a reason
why this should still be the case, this check has been removed.
r? @eddyb
cc @varkor @Centril