Closed
Description
This issue is spun out from #54503 to serve as the decision issue for a specific question. The question is what the 'mental model' for the expect
attribute should be. Two proposed options:
- The expectation is fulfilled, if a #[warn] attribute in the same location would cause a diagnostic to be emitted. The suppression of this diagnostic fulfills the expectation. (src) (Current implementation in rustc)
- The expectation is fulfilled if removing the
#[expect]
attribute would cause the warning to be emitted. (src)
@xFrednet created a list of use cases to help with the discussion of these two models; they found both models work equally well, except for use case 4 which would only be possible with the first model.