Don't require a specific order for the per-function globals, and
don't require the locals to have private linkage (apparently
internal linkage is also possible).
Exception for specific cases like linting, additional passes should
be going into the module pass manager (even if they are function
passes). The separate function pass manager is only used for very
early optimization passes.
Rather than apparending passes to the MPM, use the OptimizerLast
and EnabledOnOptLevel0 pass manager builder extension hooks, which
allow adding passes directly before finalization (alias
canonicalization and name-anon-globals).
The main effect and purpose of this change is to add sanitizer
passes at the end of the pipeline, which is where they belong.
In LLVM 9 the address sanitizer can't be used as a pass in the
early function pass manager, because it has a dependence on a
module-level analysis pass.
Do not emit type errors after parse error in last statement of block
When recovering from a parse error inside a block, do not emit type
errors generating on that block's recovered return expression.
Fix#57383.
Fix miri error in into_inner() of CString
Fix#62553
I choice to not transmute because I think it's more unsafe and in case the structure change this code should always work.
r? @RalfJung
If the explicitly given type of a `self` parameter fails to parse correctly,
we need to propagate the error rather than dropping it and causing an ICE.
Fixes#62660.
ci: add a pr builder to test tools when submodules are updated
This PR adds the x86_64-gnu-tools builders to PRs where submodules are updated.
Since it's not possible to *start* the builder only when submodule changes are detected, I opted into adding a "decider" task at the start of the job which sets the `SKIP_JOB` environment variable when submodules are not updated, and I gated the most time-consuming tasks (the actual build and artifacts upload) on the variable not being there. All of this is conditionally included in the `steps/run.yml` only when a template parameter is present, so it should only affect that builder on PRs.
The cost for this should be a dummy builder running for 2/3 minutes for each PR, and we should be able to handle it.
Fixes https://github.com/rust-lang/rust/issues/61837
r? @alexcrichton
rustc_codegen_ssa: fix range check in codegen_get_discr.
Fixes#61696, see https://github.com/rust-lang/rust/issues/61696#issuecomment-505473018 for more details.
In short, I had wanted to use `x - a <= b - a` to check whether `x` is in `a..=b` (as it's 1 comparison instead of 2 *and* `b - a` is guaranteed to fit in the same data type, while `b` itself might not), but I ended up with `x - a + c <= b - a + c` instead, because `x - a + c` was the final value needed.
That latter comparison is equivalent to checking that `x` is in `(a - c)..=b`, i.e. it also includes `(a - c)..a`, not just `a..=b`, so if `c` is not `0`, it will cause false positives.
This presented itself as the non-niche ("dataful") variant sometimes being treated like a niche variant, in the presence of uninhabited variants (which made `c`, aka the index of the first niche variant, arbitrarily large).
r? @nagisa, @rkruppe or @oli-obk