Skip to content

Rollup of 6 pull requests #123128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
847fd88
Always use tcx.coroutine_layout over calling optimized_mir directly
compiler-errors Mar 25, 2024
b7d67ea
Require coroutine kind type to be passed to TyCtxt::coroutine_layout
compiler-errors Mar 25, 2024
9bda9ac
Relax validation now
compiler-errors Mar 25, 2024
8560d01
lib: fix some unnecessary_cast clippy lint
klensy Mar 25, 2024
9154757
Implement `-L builtin:$path`
Veykril Feb 29, 2024
9ae4e3e
Make use of sysroot in librustdoc/config.rs for builtin:$path
Veykril Mar 4, 2024
2fae4ee
Make sysroot mandatory for rustdoc
Veykril Mar 6, 2024
3d65c92
Replace implementation with @RUSTC_BUILTIN prefix substitution var
Veykril Mar 6, 2024
5ddc4f2
coverage: Inline creating a dummy instance for unused functions
Zalathar Mar 22, 2024
e3f66b2
coverage: Overhaul the search for unused functions
Zalathar Mar 22, 2024
54116c8
coverage: Detect functions that have lost all their coverage statements
Zalathar Mar 22, 2024
1cca252
coverage: Re-enable `UnreachablePropagation` for coverage builds
Zalathar Mar 22, 2024
2c0a8de
CFI: Enable KCFI testing of run-pass tests
maurer Mar 25, 2024
1942f95
rustdoc: Swap fields and variant documentations
Mar 27, 2024
2973f04
Rollup merge of #121843 - ferrocene:builtin-path, r=petrochenkov
GuillaumeGomez Mar 27, 2024
8a7f285
Rollup merge of #122860 - Zalathar:unused, r=cjgillot
GuillaumeGomez Mar 27, 2024
bffeb05
Rollup merge of #123021 - compiler-errors:coroutine-layout-lol, r=oli…
GuillaumeGomez Mar 27, 2024
dc4236d
Rollup merge of #123024 - maurer:kcfi-testing, r=workingjubilee
GuillaumeGomez Mar 27, 2024
64a9360
Rollup merge of #123083 - klensy:clippy-me, r=workingjubilee
GuillaumeGomez Mar 27, 2024
c0945f0
Rollup merge of #123116 - chloekek:rustdoc-variant-swap-fields-doc, r…
GuillaumeGomez Mar 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
CFI: Enable KCFI testing of run-pass tests
This enables KCFI-based testing for all the CFI run-pass tests in the
suite today. We can add the test header on top of in-flight CFI tests
once they land.

It also enables KCFI as a sanitizer for x86_64 and aarch64 Linux to make
this possible. The sanitizer should likely be available for all aarch64,
x86_64, and riscv targets, but that isn't critical for initial testing.
  • Loading branch information
maurer committed Mar 26, 2024
commit 2c0a8de0b91d0ea9dcab390cbff430329b1342b7
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub fn target() -> Target {
stack_probes: StackProbeType::Inline,
supported_sanitizers: SanitizerSet::ADDRESS
| SanitizerSet::CFI
| SanitizerSet::KCFI
| SanitizerSet::LEAK
| SanitizerSet::MEMORY
| SanitizerSet::MEMTAG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pub fn target() -> Target {
base.static_position_independent_executables = true;
base.supported_sanitizers = SanitizerSet::ADDRESS
| SanitizerSet::CFI
| SanitizerSet::KCFI
| SanitizerSet::DATAFLOW
| SanitizerSet::LEAK
| SanitizerSet::MEMORY
Expand Down
1 change: 1 addition & 0 deletions src/tools/compiletest/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
"needs-sanitizer-cfi",
"needs-sanitizer-dataflow",
"needs-sanitizer-hwaddress",
"needs-sanitizer-kcfi",
"needs-sanitizer-leak",
"needs-sanitizer-memory",
"needs-sanitizer-memtag",
Expand Down
10 changes: 7 additions & 3 deletions tests/ui/sanitizer/cfi-closure-fn-ptr-cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@
//
// This checks that the reified function pointer will have the expected alias set at its call-site.

//@ needs-sanitizer-cfi
//@ revisions: cfi kcfi
// FIXME(#122848) Remove only-linux once OSX CFI binaries work
//@ only-linux
//@ compile-flags: --crate-type=bin -Cprefer-dynamic=off -Clto -Zsanitizer=cfi
//@ compile-flags: -C target-feature=-crt-static -C codegen-units=1 -C opt-level=0
//@ [cfi] needs-sanitizer-cfi
//@ [kcfi] needs-sanitizer-kcfi
//@ compile-flags: -C target-feature=-crt-static
//@ [cfi] compile-flags: -C codegen-units=1 -C lto -C prefer-dynamic=off -C opt-level=0
//@ [cfi] compile-flags: -Z sanitizer=cfi
//@ [kcfi] compile-flags: -Z sanitizer=kcfi
//@ run-pass

pub fn main() {
Expand Down
10 changes: 7 additions & 3 deletions tests/ui/sanitizer/cfi-complex-receiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
// * Arc<dyn Foo> as for custom receivers
// * &dyn Bar<T=Baz> for type constraints

//@ needs-sanitizer-cfi
//@ revisions: cfi kcfi
// FIXME(#122848) Remove only-linux once OSX CFI binaries work
//@ only-linux
//@ compile-flags: --crate-type=bin -Cprefer-dynamic=off -Clto -Zsanitizer=cfi
//@ compile-flags: -C target-feature=-crt-static -C codegen-units=1 -C opt-level=0
//@ [cfi] needs-sanitizer-cfi
//@ [kcfi] needs-sanitizer-kcfi
//@ compile-flags: -C target-feature=-crt-static
//@ [cfi] compile-flags: -C codegen-units=1 -C lto -C prefer-dynamic=off -C opt-level=0
//@ [cfi] compile-flags: -Z sanitizer=cfi
//@ [kcfi] compile-flags: -Z sanitizer=kcfi
//@ run-pass

use std::sync::Arc;
Expand Down
10 changes: 7 additions & 3 deletions tests/ui/sanitizer/cfi-self-ref.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
// Check that encoding self-referential types works with #[repr(transparent)]

//@ needs-sanitizer-cfi
//@ revisions: cfi kcfi
// FIXME(#122848) Remove only-linux once OSX CFI binaries work
//@ only-linux
//@ compile-flags: --crate-type=bin -Cprefer-dynamic=off -Clto -Zsanitizer=cfi
//@ compile-flags: -C target-feature=-crt-static -C codegen-units=1 -C opt-level=0
//@ [cfi] needs-sanitizer-cfi
//@ [kcfi] needs-sanitizer-kcfi
//@ compile-flags: -C target-feature=-crt-static
//@ [cfi] compile-flags: -C codegen-units=1 -C lto -C prefer-dynamic=off -C opt-level=0
//@ [cfi] compile-flags: -Z sanitizer=cfi
//@ [kcfi] compile-flags: -Z sanitizer=kcfi
//@ run-pass

use std::marker::PhantomData;
Expand Down
10 changes: 7 additions & 3 deletions tests/ui/sanitizer/cfi-virtual-auto.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
// Tests that calling a trait object method on a trait object with additional auto traits works.

//@ needs-sanitizer-cfi
//@ revisions: cfi kcfi
// FIXME(#122848) Remove only-linux once OSX CFI binaries work
//@ only-linux
//@ compile-flags: --crate-type=bin -Cprefer-dynamic=off -Clto -Zsanitizer=cfi
//@ compile-flags: -C target-feature=-crt-static -C codegen-units=1 -C opt-level=0
//@ [cfi] needs-sanitizer-cfi
//@ [kcfi] needs-sanitizer-kcfi
//@ compile-flags: -C target-feature=-crt-static
//@ [cfi] compile-flags: -C codegen-units=1 -C lto -C prefer-dynamic=off -C opt-level=0
//@ [cfi] compile-flags: -Z sanitizer=cfi
//@ [kcfi] compile-flags: -Z sanitizer=kcfi
//@ run-pass

trait Foo {
Expand Down