-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
ICE: NormalizationError during linting #115143
Comments
As referenced in the other issue this now also happens on stable since >= 1.70. The culprint seems to be this type alias: pub type CreateFn<T> = extern "C" fn(
Option<&<T as Loadable>::ArgsType>,
<T as Loadable>::CInputArg,
lib: LibArc,
logger: Option<&'static PluginLogger>,
&mut MaybeUninit<<T as Loadable>::Instance>,
) -> i32;
pub trait Loadable: Sized {
type Instance: StableAbi;
type InputArg;
type CInputArg: StableAbi;
type ArgsType;
...
} Removing the reference in the Option works around this panic. |
Here's a minimal example that reproduces the issue: pub type SomeFn<T> = extern "C" fn(
Option<&<T as SomeTrait>::SomeType>,
);
pub trait SomeTrait {
type SomeType;
} Interestingly, this only happens while the function is extern "C". |
WG-prioritization assigning priority (Zulip discussion). cc: @davidtwco for the bisection pointing to 0ab38e9 @rustbot label -I-prioritize +P-high |
@rustbot claim |
The panic originates in the rust/compiler/rustc_lint/src/types.rs Line 920 in 3d24970
It happens because Since the normalization failure can be legitimate as in this case, I feel this unwrap: rust/compiler/rustc_lint/src/types.rs Line 920 in 3d24970
should be removed to fix the issue. However, I'm not sure what the enclosing method repr_nullable_ptr() should do upon receiving a None from SizeSkeleton::compute() . I'd presume it should return None .
Please review and let me know if this analysis makes sense. cc: @davidtwco |
Closely related PR: #115631 . It fixes an ICE due to similar causes but on a different line. In fact the very next line. |
@gurry Yeah, I think making |
Code
https://github.com/memflow/memflow/ at
ec4d19b5600597d0f9e463c3ad085af288f77f5c
Error output
Backtrace
searched nightlies: from nightly-2023-01-01 to nightly-2023-08-14
regressed nightly: nightly-2023-07-04
searched commit range: 839e9a6...0ab38e9
regressed commit: 0ab38e9
bisected with cargo-bisect-rustc v0.6.6
Host triple: x86_64-unknown-linux-gnu
Reproduce with:
The text was updated successfully, but these errors were encountered: