rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.96k stars 12.68k forks source link

Unnecessary HasParamEnv bound on C for FnTypeExt #63856

Open bjorn3 opened 5 years ago

bjorn3 commented 5 years ago

https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/layout/trait.FnTypeExt.html

varkor commented 5 years ago

@bjorn3: what do you mean by "unnecessary"? None of the code requires the bound on the trait itself (though it is required in the impl), but that's also true for the other bounds, not just HasParamEnv.

bjorn3 commented 5 years ago

I cant find anything referencing self.param_env() insidr the impl.

varkor commented 5 years ago

It's used transitively by the rustc_target::abi::TyLayoutMethods<'_, C> for `&ty::TyS<'_> impl.

bjorn3 commented 5 years ago

I get it. I think FnTypeExt should always use ParamEnv::reveal_all() though, as it is used only after monomorphization.