about summary refs log tree commit diff
path: root/tests/rustdoc-js/impl-trait-inlining.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-12-08 09:12:31 +0000
committerbors <bors@rust-lang.org>2024-12-08 09:12:31 +0000
commitf415c07494b98e4559e4b13a9c5f867b0e6b2444 (patch)
tree7973df09be0d15fb0d048e94a63aec56f0608fd3 /tests/rustdoc-js/impl-trait-inlining.rs
parent728f2daab42ba8f1b3d5caab62495798d1eabfa1 (diff)
parent25ad0478cb0975f10db6db3abb28d54df8e07430 (diff)
downloadrust-f415c07494b98e4559e4b13a9c5f867b0e6b2444.tar.gz
rust-f415c07494b98e4559e4b13a9c5f867b0e6b2444.zip
Auto merge of #133522 - estebank:dont-suggest-unstable-trait, r=compiler-errors
Don't suggest restricting bound with unstable traits on stable and mention it's unstable on nightly

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`
```

Fix #133511.
Diffstat (limited to 'tests/rustdoc-js/impl-trait-inlining.rs')
0 files changed, 0 insertions, 0 deletions