rust/tests/ui/cast
Nilstrieb b6657a8ad4 Never consider raw pointer casts to be trival
HIR typeck tries to figure out which casts are trivial by doing them as
coercions and seeing whether this works. Since HIR typeck is oblivious
of lifetimes, this doesn't work for pointer casts that only change the
lifetime of the pointee, which are, as borrowck will tell you, not
trivial.

This change makes it so that raw pointer casts are never considered
trivial.

This also incidentally fixes the "trivial cast" lint false positive on
the same code. Unfortunately, "trivial cast" lints are now never emitted
on raw pointer casts, even if they truly are trivial. This could be
fixed by also doing the lint in borrowck for raw pointers specifically.
2023-10-25 23:15:18 +02:00
..
cast-as-bool.rs Migrate 'cast to bool' diagnostic 2023-09-18 14:03:57 +00:00
cast-as-bool.stderr Migrate 'cast to bool' diagnostic 2023-09-18 14:03:57 +00:00
cast-char.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-char.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-does-fallback.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-errors-issue-43825.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-errors-issue-43825.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-from-nil.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-from-nil.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-int-to-char.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-int-to-char.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-macro-lhs.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-macro-lhs.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-pointee-projection.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-region-to-uint.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-rfc0401-2.rs add source type for invalid bool casts 2023-09-11 18:10:07 +00:00
cast-rfc0401-2.stderr Migrate 'cast to bool' diagnostic 2023-09-18 14:03:57 +00:00
cast-rfc0401-vtable-kinds.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-rfc0401.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-to-bare-fn.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-to-bare-fn.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-to-infer-ty.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-to-nil.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-to-nil.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-to-unsized-trait-object-suggestion.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-to-unsized-trait-object-suggestion.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
casts-differing-anon.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
casts-differing-anon.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
casts-issue-46365.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
casts-issue-46365.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
codegen-object-shim.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
fat-ptr-cast-rpass.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
fat-ptr-cast.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
fat-ptr-cast.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-10991.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-10991.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-17444.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-17444.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-84213.fixed Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-84213.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-84213.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-85586.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-85586.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-88621.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-88621.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-89497.fixed Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-89497.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-89497.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-106883-is-empty.rs suggest is_empty for collections when casting to bool 2023-01-15 22:17:54 +13:00
issue-106883-is-empty.stderr suggest is_empty for collections when casting to bool 2023-01-15 22:17:54 +13:00
ptr-to-ptr-different-regions.rs Never consider raw pointer casts to be trival 2023-10-25 23:15:18 +02:00
supported-cast.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unsized-struct-cast.rs make unsized cast illegal 2023-09-22 18:57:27 +03:00
unsized-struct-cast.stderr make unsized cast illegal 2023-09-22 18:57:27 +03:00
unsupported-cast.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unsupported-cast.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00