#![feature(trivial_bounds)]
incorrectly suggested, and then causing linker errors on Windows
#128682
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-bug
Category: This is a bug.
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
E-needs-mcve
Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
F-trivial_bounds
`#![feature(trivial_bounds)]`
O-windows-msvc
Toolchain: MSVC, Operating system: Windows
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
MWE (this does indeed require two separate crates and dynamic linking):
I expected to see this happen: The
MweUnreflected
field does not implementReflect
, which is a requirement ofMweReflected
. Therefore, Rust should show an error relating to unsatisfied trait bounds, like what happens if you don't add#![feature(trivial_bounds)]
.Instead, this happened:
Reflect
has lots of generic implementations, including for lots of tuple types, and for some reason the compiler suggests to use#![feature(trivial_bounds)]
(That's the first error). When using this feature, instead of giving the same (or a better) error message, Rust instead causes a linker error, where the variousReflect
trait functions onMweUnreflected
cannot be found by link.exe.Meta
rustc --version --verbose
:Linker errors
This issue was previously discussed here (the origin of the Reflect macro and trait). Related to #48214.
The text was updated successfully, but these errors were encountered: