Skip to content

Commit 8920002

Browse files
author
Robert Zakrzewski
committed
Add missing types in the type_kind function
reorder type_kind reorder type_kind reorder type_kind
1 parent 10798db commit 8920002

File tree

2 files changed

+47
-4
lines changed

2 files changed

+47
-4
lines changed

src/type_.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,22 @@ impl<'gcc, 'tcx> BaseTypeMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
192192

193193
#[cfg(feature = "master")]
194194
fn type_kind(&self, typ: Type<'gcc>) -> TypeKind {
195-
if self.is_int_type_or_bool(typ) {
195+
if typ.get_pointee().is_some() {
196+
TypeKind::Pointer
197+
} else if typ.is_vector() {
198+
TypeKind::Vector
199+
} else if typ.dyncast_array().is_some() {
200+
TypeKind::Array
201+
} else if typ.is_struct().is_some() {
202+
TypeKind::Struct
203+
} else if typ.dyncast_function_ptr_type().is_some() {
204+
TypeKind::Function
205+
} else if self.is_int_type_or_bool(typ) {
196206
TypeKind::Integer
197207
} else if typ.is_compatible_with(self.float_type) {
198208
TypeKind::Float
199209
} else if typ.is_compatible_with(self.double_type) {
200210
TypeKind::Double
201-
} else if typ.is_vector() {
202-
TypeKind::Vector
203211
} else if typ.is_floating_point() {
204212
match typ.get_size() {
205213
2 => TypeKind::Half,
@@ -208,9 +216,11 @@ impl<'gcc, 'tcx> BaseTypeMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
208216
16 => TypeKind::FP128,
209217
_ => TypeKind::Void,
210218
}
219+
} else if typ == self.type_void() {
220+
TypeKind::Void
211221
} else {
212222
// TODO(antoyo): support other types.
213-
TypeKind::Void
223+
unimplemented!();
214224
}
215225
}
216226

tests/failing-ui-tests.txt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,36 @@ tests/ui/consts/issue-94675.rs
7575
tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.rs
7676
tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.rs
7777

78+
tests/ui/lint/unsafe_code/forge_unsafe_block.rs
79+
tests/ui/lint/unused-qualification-in-derive-expansion.rs
80+
tests/ui/macros/macro-quote-test.rs
81+
tests/ui/macros/proc_macro.rs
82+
tests/ui/panic-runtime/lto-unwind.rs
83+
tests/ui/resolve/derive-macro-1.rs
84+
tests/ui/resolve/derive-macro-2.rs
85+
tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-pretty.rs
86+
tests/ui/rfcs/rfc-2565-param-attrs/issue-64682-dropping-first-attrs-in-impl-fns.rs
87+
tests/ui/rfcs/rfc-3348-c-string-literals/edition-spans.rs
88+
tests/ui/rust-2018/suggestions-not-always-applicable.rs
89+
tests/ui/rust-2021/reserved-prefixes-via-macro.rs
90+
tests/ui/underscore-imports/duplicate.rs
91+
tests/ui/async-await/issues/issue-60674.rs
92+
tests/ui/attributes/main-removed-2/main.rs
93+
tests/ui/cfg/assume-incomplete-release/assume-incomplete.rs
94+
tests/ui/crate-loading/cross-compiled-proc-macro.rs
95+
tests/ui/derives/derive-marker-tricky.rs
96+
tests/ui/diagnostic_namespace/existing_proc_macros.rs
97+
tests/ui/fmt/format-args-capture-issue-106408.rs
98+
tests/ui/fmt/indoc-issue-106408.rs
99+
tests/ui/hygiene/issue-77523-def-site-async-await.rs
100+
tests/ui/inherent-impls-overlap-check/no-overlap.rs
101+
tests/ui/enum-discriminant/issue-46519.rs
102+
tests/ui/issues/issue-45731.rs
103+
tests/ui/lint/test-allow-dead-extern-static-no-warning.rs
104+
tests/ui/macros/macro-comma-behavior-rpass.rs
105+
tests/ui/macros/rfc-2011-nicer-assert-messages/assert-with-custom-errors-does-not-create-unnecessary-code.rs
106+
tests/ui/macros/rfc-2011-nicer-assert-messages/feature-gate-generic_assert.rs
107+
tests/ui/macros/stringify.rs
108+
tests/ui/reexport-test-harness-main.rs
109+
tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-in-test.rs
110+
tests/ui/binding/fn-arg-incomplete-pattern-drop-order.rs

0 commit comments

Comments
 (0)