-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Do not ICE in codegen when using a extern_type static #58192
Conversation
llextra: None, | ||
layout: layout, | ||
align: layout.align.abi | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does feel a bit reckless to me. Would it be better to instead make the change here so that this is only allowed in the case of a r-value that is a reference to a static?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the right thing to do is to create a new constructor method (new_thin_place
maybe?) that uses !type_has_metadata
instead of is_sized
in the assertion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is definitely a good check to add. At the very least it seems like a good idea to add it inline here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oli-obk Added PlaceRef::new_thin_place
. It is only used in place.rs
currently, so I didn't make the function pub
.
The layout of a extern_type static is unsized, but may pass the Well-Formed check in typeck. As a result, we cannot assume that a static is sized when generating the `Place` for an r-value.
0df22ba
to
80c052b
Compare
@bors r+ rollup |
📌 Commit 80c052b has been approved by |
Do not ICE in codegen when using a extern_type static The layout of a extern_type static is unsized, but may pass the Well-Formed check in typeck (See rust-lang#55257). As a result, we cannot assume that a static is sized when generating the `Place` for an r-value. Fixes: rust-lang#57876 r? @oli-obk
Rollup of 23 pull requests Successful merges: - #58118 (Transition libtest to 2018 edition) - #58119 (libproc_macro => 2018) - #58123 (Avoid some bounds checks in binary_heap::{PeekMut,Hole}) - #58124 (libsyntax_pos => 2018) - #58133 (libsyntax_ext => 2018) - #58136 (Improve error message and docs for non-UTF-8 bytes in stdio on Windows) - #58156 (update submodule: rust-installer from 27dec6c to ccdc47b) - #58192 (Do not ICE in codegen when using a extern_type static) - #58193 (Move librustc to 2018) - #58210 (Make an assert debug-only in `find_constraint_paths_between_regions`.) - #58217 (librustc_tsan => 2018) - #58218 (librustc_msan => 2018) - #58219 (librustc_asan => 2018) - #58220 (libprofiler_builtins => 2018) - #58223 (librustc_lsan => 2018) - #58225 (librustc_fs_util => 2018) - #58228 (librustc_plugin => 2018) - #58236 (librustc_resolve => 2018) - #58237 (Fix broken grammar in iter::from_fn() docs) - #58239 (librustc_apfloat => 2018) - #58240 (librustc_errors => 2018) - #58241 (librustc_llvm => 2018) - #58242 (Document the one TyKind that isn't documented) Failed merges: - #58185 (Remove images' url to make it work even without internet connection) r? @ghost
The layout of a extern_type static is unsized, but may pass the
Well-Formed check in typeck (See #55257). As a result, we
cannot assume that a static is sized when generating the
Place
for an r-value.
Fixes: #57876
r? @oli-obk