about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/coverage/counters.rs
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-11-27 03:20:22 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-12-07 21:10:44 +0000
commit68253e14ee3d0e81881bc908b07b5ba141daf226 (patch)
tree953800ab5bd068e09c8c864f2e84455c806207ca /compiler/rustc_mir_transform/src/coverage/counters.rs
parent9c707a8b769523bb6768bf58e74fa2c39cc24844 (diff)
downloadrust-68253e14ee3d0e81881bc908b07b5ba141daf226.tar.gz
rust-68253e14ee3d0e81881bc908b07b5ba141daf226.zip
Don't suggest restricting bound with unstable traits on stable
On nightly, we mention the trait is unstable

```
error[E0277]: the trait bound `T: Unstable` is not satisfied
  --> $DIR/unstable-trait-suggestion.rs:13:9
   |
LL |     foo(t)
   |     --- ^ the trait `Unstable` is not implemented for `T`
   |     |
   |     required by a bound introduced by this call
   |
note: required by a bound in `foo`
  --> $DIR/unstable-trait-suggestion.rs:9:11
   |
LL | fn foo<T: Unstable>(_: T) {}
   |           ^^^^^^^^ required by this bound in `foo`
help: consider restricting type parameter `T` but it is an `unstable` trait
   |
LL | pub fn demo<T: Unstable>(t: T) {
   |              ++++++++++
```

On stable, we don't suggest the trait at all

```
error[E0277]: the trait bound `T: Unstable` is not satisfied
  --> $DIR/unstable-trait-suggestion.rs:13:9
   |
LL |     foo(t)
   |     --- ^ the trait `Unstable` is not implemented for `T`
   |     |
   |     required by a bound introduced by this call
   |
note: required by a bound in `foo`
  --> $DIR/unstable-trait-suggestion.rs:9:11
   |
LL | fn foo<T: Unstable>(_: T) {}
   |           ^^^^^^^^ required by this bound in `foo`
```
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/counters.rs')
0 files changed, 0 insertions, 0 deletions