about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-10-25 21:33:13 +0000
committerbors <bors@rust-lang.org>2021-10-25 21:33:13 +0000
commitffba4309241a7a21df4ec7b16f1357cbcd327d6e (patch)
tree362af1c0e72c6feb18d6e700f322b25c0bb32e09 /src
parent29b1248025b19bd132c8047fc710ea9314b9b76b (diff)
parent26e9a719f230815b2c535777c466030c696c9d89 (diff)
Auto merge of #90282 - matthiaskrgr:rollup-c6trbff, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #89581 (Add -Z no-unique-section-names to reduce ELF header bloat.)
 - #90196 (Fix and extent ControlFlow `traverse_inorder` example)
 - #90255 (:arrow_up: rust-analyzer)
 - #90266 (Prevent duplicate caller bounds candidates by exposing default substs in Unevaluated)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src')
-rw-r--r--src/doc/unstable-book/src/compiler-flags/no-unique-section-names.md9
-rw-r--r--src/test/ui/const-generics/expose-default-substs-param-env.rs9
-rw-r--r--src/test/ui/const-generics/issues/issue-89334.rs16
m---------src/tools/rust-analyzer32
4 files changed, 50 insertions, 16 deletions
diff --git a/src/doc/unstable-book/src/compiler-flags/no-unique-section-names.md b/src/doc/unstable-book/src/compiler-flags/no-unique-section-names.md
new file mode 100644
index 00000000000..5c1c7cda701
--- /dev/null
+++ b/src/doc/unstable-book/src/compiler-flags/no-unique-section-names.md
@@ -0,0 +1,9 @@
+# `no-unique-section-names`
+
+------------------------
+
+This flag currently applies only to ELF-based targets using the LLVM codegen backend. It prevents the generation of unique ELF section names for each separate code and data item when `-Z function-sections` is also in use, which is the default for most targets. This option can reduce the size of object files, and depending on the linker, the final ELF binary as well.
+
+For example, a function `func` will by default generate a code section called `.text.func`. Normally this is fine because the linker will merge all those `.text.*` sections into a single one in the binary. However, starting with [LLVM 12](https://github.com/llvm/llvm-project/commit/ee5d1a04), the backend will also generate unique section names for exception handling, so you would see a section name of `.gcc_except_table.func` in the object file and potentially in the final ELF binary, which could add significant bloat to programs that contain many functions.
+
+This flag instructs LLVM to use the same `.text` and `.gcc_except_table` section name for each function, and it is analogous to Clang's `-fno-unique-section-names` option.
diff --git a/src/test/ui/const-generics/expose-default-substs-param-env.rs b/src/test/ui/const-generics/expose-default-substs-param-env.rs
new file mode 100644
index 00000000000..e40c93116af
--- /dev/null
+++ b/src/test/ui/const-generics/expose-default-substs-param-env.rs
@@ -0,0 +1,9 @@
+// build-pass
+
+#![feature(generic_const_exprs)]
+#![allow(unused_braces, incomplete_features)]
+
+pub trait Foo<const N: usize> {}
+pub trait Bar: Foo<{ 1 }> { }
+
+fn main() {}
diff --git a/src/test/ui/const-generics/issues/issue-89334.rs b/src/test/ui/const-generics/issues/issue-89334.rs
new file mode 100644
index 00000000000..b15b7428cdd
--- /dev/null
+++ b/src/test/ui/const-generics/issues/issue-89334.rs
@@ -0,0 +1,16 @@
+// build-pass
+
+#![feature(generic_const_exprs)]
+#![allow(unused_braces, incomplete_features)]
+
+pub trait AnotherTrait{
+    const ARRAY_SIZE: usize;
+}
+pub trait Shard<T: AnotherTrait>:
+    AsMut<[[u8; T::ARRAY_SIZE]]>
+where
+    [(); T::ARRAY_SIZE]: Sized
+{
+}
+
+fn main() {}
diff --git a/src/tools/rust-analyzer b/src/tools/rust-analyzer
-Subproject 91cbda43c2af82b9377eff70a21f59ade18cd23
+Subproject 1f47693e02809c97db61b51247ae4e4d46744c6