Revert dist-x86_64-linux update to Clang 11
This reverts commit cb6787ae82, reversing changes made to 0248c6f178.
The change causes errors when linking rustc shared objects with the binutils linker.
Fixes#81554.
r? `@Mark-Simulacrum`
clashing_extern_declarations: Use symbol interning to avoid string alloc.
Use symbol interning as a hack to avoid allocating a string for every symbol name we store in the seen set. This hopefully addresses the minor perf regression described in https://github.com/rust-lang/rust/pull/80009#issuecomment-763526902.
r? `@nagisa`
The `Deref` cycle checks added as part of #80653 were "unbalanced" in the sense
that the main content code path checks for cycles _before_ descending, while the
sidebar checks _after_. Checking _before_ is correct, so this changes the
sidebar path to match the main content path.
This ensures that all stack slots are aligned to 16 bytes. Without this
linking against crates compiled with cg_llvm may cause a crash due to
simd instructions requiring a 16 byte alignment.
Update dist-various to Ubuntu 20.04
This updates the dist-various-1 and dist-various-2 images to Ubuntu
20.04. This requires some adjustments:
* `DEBIAN_FRONTEND=noninteractive` required for apt install.
* `team-gcc-argm-embedded` PPA does not support focal. However,
we can simply use the distro-provided `gcc-arm-none-eabi`. Per
the comment, the PPA was only used to get a newer version.
* rumprun has to be updated to avoid a linker error.
* We need to build rumrun with `NOGCCERROR`, which disables use
of `-Werror` and allows building with a newer compiler.
* We need to install `libtinfo5`, which appears to be a dependency
of the clang used during the fuchsia build.
* We need to switch to `g++-8` rather than `g++-7`, as at least
`g++-7-arm-linux-gnueabi` is not available on focal.
* We need to upgrade to GCC 6.5 for the Solaris build, as GCC 6.4
does not support the newer libisl version.
r? `@Mark-Simulacrum`
The issue:
See this Rust playground link: https://play.rust-lang.org/?edition=2018&gist=12cb5d1e7527f8c37743b87fc4a53748
Run the above with clippy to see the following warning:
```
warning: returning the result of a `let` binding from a block
--> src/main.rs:24:5
|
23 | let value = Foo::new(&x).value();
| --------------------------------- unnecessary `let` binding
24 | value
| ^^^^^
|
= note: `#[warn(clippy::let_and_return)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
23 |
24 | Foo::new(&x).value()
|
```
Implementing the suggested fix, removing the temporary let binding,
yields a compiler error:
```
error[E0597]: `x` does not live long enough
--> src/main.rs:23:14
|
23 | Foo::new(&x).value()
| ---------^^-
| | |
| | borrowed value does not live long enough
| a temporary with access to the borrow is created here ...
24 | }
| -
| |
| `x` dropped here while still borrowed
| ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `Foo`
|
= note: the temporary is part of an expression at the end of a block;
consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
|
23 | let x = Foo::new(&x).value(); x
| ^^^^^^^ ^^^
```
The fix:
Of course, clippy looks like it should already handle this edge case;
however, it appears `utils::fn_def_id` is not returning a `DefId` for
`Foo::new`. Changing the `qpath_res` lookup to use the child Path
`hir_id` instead of the parent Call `hir_id` fixes the issue.