librustc: Forbid transmute from being called on types whose size is
only known post-monomorphization, and report `transmute` errors before
the code is generated for that `transmute`.
This can break code that looked like:
unsafe fn f<T>(x: T) {
let y: int = transmute(x);
}
Change such code to take a type parameter that has the same size as the
type being transmuted to.
Closes #12898.
[breaking-change]
This commit is contained in:
committed by
Alex Crichton
parent
8c4a10a159
commit
c9f3f47702
@@ -134,7 +134,7 @@ impl DynamicLibrary {
|
||||
}
|
||||
|
||||
/// Access the value at the symbol of the dynamic library
|
||||
pub unsafe fn symbol<T>(&self, symbol: &str) -> Result<T, String> {
|
||||
pub unsafe fn symbol<T>(&self, symbol: &str) -> Result<*T, String> {
|
||||
// This function should have a lifetime constraint of 'a on
|
||||
// T but that feature is still unimplemented
|
||||
|
||||
|
||||
Reference in New Issue
Block a user