Skip to content

Commit 1e96d86

Browse files
authored
Merge pull request #708 from rust-lang/tests/remove-passing-tests
Remove tests that pass
2 parents 640c067 + efc8815 commit 1e96d86

File tree

3 files changed

+20
-38
lines changed

3 files changed

+20
-38
lines changed

src/common.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,19 @@ impl<'gcc, 'tcx> ConstCodegenMethods for CodegenCx<'gcc, 'tcx> {
265265
let alloc_id = prov.alloc_id();
266266
let base_addr = match self.tcx.global_alloc(alloc_id) {
267267
GlobalAlloc::Memory(alloc) => {
268+
// For ZSTs directly codegen an aligned pointer.
269+
// This avoids generating a zero-sized constant value and actually needing a
270+
// real address at runtime.
271+
if alloc.inner().len() == 0 {
272+
assert_eq!(offset.bytes(), 0);
273+
let val = self.const_usize(alloc.inner().align.bytes());
274+
return if matches!(layout.primitive(), Pointer(_)) {
275+
self.context.new_cast(None, val, ty)
276+
} else {
277+
self.const_bitcast(val, ty)
278+
};
279+
}
280+
268281
let init = self.const_data_from_alloc(alloc);
269282
let alloc = alloc.inner();
270283
let value = match alloc.mutability {

src/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ pub(crate) fn const_alloc_to_gcc_uncached<'gcc>(
330330
// and we properly interpret the provenance as a relocation pointer offset.
331331
alloc.inspect_with_uninit_and_ptr_outside_interpreter(offset..(offset + pointer_size)),
332332
)
333-
.expect("const_alloc_to_llvm: could not read relocation pointer")
333+
.expect("const_alloc_to_gcc_uncached: could not read relocation pointer")
334334
as u64;
335335

336336
let address_space = cx.tcx.global_alloc(alloc_id).address_space(cx);

tests/failing-ui-tests.txt

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,12 @@
11
tests/ui/allocator/no_std-alloc-error-handler-custom.rs
22
tests/ui/allocator/no_std-alloc-error-handler-default.rs
33
tests/ui/asm/may_unwind.rs
4-
tests/ui/functions-closures/parallel-codegen-closures.rs
5-
tests/ui/linkage-attr/linkage1.rs
6-
tests/ui/lto/dylib-works.rs
7-
tests/ui/sepcomp/sepcomp-cci.rs
8-
tests/ui/sepcomp/sepcomp-extern.rs
9-
tests/ui/sepcomp/sepcomp-fns-backwards.rs
10-
tests/ui/sepcomp/sepcomp-fns.rs
11-
tests/ui/sepcomp/sepcomp-statics.rs
124
tests/ui/asm/x86_64/may_unwind.rs
13-
tests/ui/panics/catch-unwind-bang.rs
145
tests/ui/drop/dynamic-drop-async.rs
156
tests/ui/cfg/cfg-panic-abort.rs
16-
tests/ui/drop/repeat-drop.rs
17-
tests/ui/coroutine/panic-drops-resume.rs
18-
tests/ui/fmt/format-args-capture.rs
19-
tests/ui/coroutine/panic-drops.rs
207
tests/ui/intrinsics/panic-uninitialized-zeroed.rs
218
tests/ui/iterators/iter-sum-overflow-debug.rs
229
tests/ui/iterators/iter-sum-overflow-overflow-checks.rs
23-
tests/ui/mir/mir_calls_to_shims.rs
2410
tests/ui/mir/mir_drop_order.rs
2511
tests/ui/mir/mir_let_chains_drop_order.rs
2612
tests/ui/oom_unwind.rs
@@ -31,43 +17,27 @@ tests/ui/unwind-no-uwtable.rs
3117
tests/ui/parser/unclosed-delimiter-in-dep.rs
3218
tests/ui/consts/missing_span_in_backtrace.rs
3319
tests/ui/drop/dynamic-drop.rs
34-
tests/ui/issues/issue-43853.rs
35-
tests/ui/issues/issue-47364.rs
36-
tests/ui/macros/rfc-2011-nicer-assert-messages/assert-without-captures-does-not-create-unnecessary-code.rs
37-
tests/ui/rfcs/rfc-1857-stabilize-drop-order/drop-order.rs
3820
tests/ui/rfcs/rfc-2091-track-caller/std-panic-locations.rs
3921
tests/ui/simd/issue-17170.rs
4022
tests/ui/simd/issue-39720.rs
41-
tests/ui/alloc-error/default-alloc-error-hook.rs
42-
tests/ui/coroutine/panic-safe.rs
4323
tests/ui/issues/issue-14875.rs
4424
tests/ui/issues/issue-29948.rs
45-
tests/ui/panics/nested_panic_caught.rs
4625
tests/ui/process/println-with-broken-pipe.rs
4726
tests/ui/lto/thin-lto-inlines2.rs
48-
tests/ui/lto/weak-works.rs
49-
tests/ui/panic-runtime/lto-abort.rs
50-
tests/ui/lto/thin-lto-inlines.rs
51-
tests/ui/lto/thin-lto-global-allocator.rs
52-
tests/ui/lto/msvc-imp-present.rs
27+
tests/ui/panic-runtime/lto-abort.rs
5328
tests/ui/lto/lto-thin-rustc-loads-linker-plugin.rs
54-
tests/ui/lto/all-crates.rs
5529
tests/ui/async-await/deep-futures-are-freeze.rs
5630
tests/ui/coroutine/resume-after-return.rs
5731
tests/ui/simd/masked-load-store.rs
5832
tests/ui/simd/repr_packed.rs
5933
tests/ui/async-await/in-trait/dont-project-to-specializable-projection.rs
6034
tests/ui/consts/try-operator.rs
6135
tests/ui/coroutine/unwind-abort-mix.rs
62-
tests/ui/type-alias-impl-trait/rpit_tait_equality_in_canonical_query.rs
63-
tests/ui/impl-trait/equality-in-canonical-query.rs
6436
tests/ui/consts/issue-miri-1910.rs
65-
tests/ui/mir/mir_heavy_promoted.rs
6637
tests/ui/consts/const_cmp_type_id.rs
6738
tests/ui/consts/issue-73976-monomorphic.rs
6839
tests/ui/consts/issue-94675.rs
6940
tests/ui/traits/const-traits/const-drop-fail.rs
70-
tests/ui/traits/const-traits/const-drop.rs
7141
tests/ui/runtime/on-broken-pipe/child-processes.rs
7242
tests/ui/sanitizer/cfi/assoc-ty-lifetime-issue-123053.rs
7343
tests/ui/sanitizer/cfi/async-closures.rs
@@ -85,14 +55,9 @@ tests/ui/sanitizer/cfi/can-reveal-opaques.rs
8555
tests/ui/sanitizer/kcfi-mangling.rs
8656
tests/ui/statics/const_generics.rs
8757
tests/ui/backtrace/dylib-dep.rs
88-
tests/ui/errors/pic-linker.rs
8958
tests/ui/delegation/fn-header.rs
90-
tests/ui/consts/zst_no_llvm_alloc.rs
9159
tests/ui/consts/const-eval/parse_ints.rs
92-
tests/ui/simd/intrinsic/generic-arithmetic-pass.rs
9360
tests/ui/simd/intrinsic/generic-as.rs
94-
tests/ui/backtrace/backtrace.rs
95-
tests/ui/lifetimes/tail-expr-lock-poisoning.rs
9661
tests/ui/runtime/rt-explody-panic-payloads.rs
9762
tests/ui/codegen/equal-pointers-unequal/as-cast/inline1.rs
9863
tests/ui/codegen/equal-pointers-unequal/as-cast/inline2.rs
@@ -108,5 +73,9 @@ tests/ui/codegen/equal-pointers-unequal/strict-provenance/segfault.rs
10873
tests/ui/codegen/equal-pointers-unequal/strict-provenance/zero.rs
10974
tests/ui/simd/simd-bitmask-notpow2.rs
11075
tests/ui/codegen/StackColoring-not-blowup-stack-issue-40883.rs
111-
tests/ui/uninhabited/uninhabited-transparent-return-abi.rs
11276
tests/ui/numbers-arithmetic/u128-as-f32.rs
77+
tests/ui/lto/all-crates.rs
78+
tests/ui/uninhabited/uninhabited-transparent-return-abi.rs
79+
tests/ui/coroutine/panic-drops-resume.rs
80+
tests/ui/coroutine/panic-drops.rs
81+
tests/ui/coroutine/panic-safe.rs

0 commit comments

Comments
 (0)