Files
rust/tests/ui/traits/next-solver/dont-canonicalize-re-error.stderr
Guillaume Gomez 80f20c98f3 Rollup merge of #142671 - davidtwco:no-default-bounds-attr, r=lcnr
add #![rustc_no_implicit_bounds]

Follow-up from rust-lang/rust#137944.

Adds a new `rustc_attrs` attribute that stops rustc from adding any default bounds. Useful for tests where default bounds just add noise and make debugging harder.

After reviewing all tests with `?Sized`, these tests seem like they could probably benefit from `#![rustc_no_implicit_bounds]`.

- Skipping most of `tests/ui/unsized` as these seem to want to test `?Sized`
- Skipping tests that used `Box<T>` because it's still bound by `T: MetaSized`
- Skipping parsing or other tests that cared about `?Sized` syntactically
- Skipping tests for `derive(CoercePointee)` because this appears to check that the pointee type is relaxed with `?Sized` explicitly

r? `@lcnr`
2025-06-27 15:04:52 +02:00

25 lines
918 B
Plaintext

error[E0261]: use of undeclared lifetime name `'missing`
--> $DIR/dont-canonicalize-re-error.rs:27:26
|
LL | impl<A: Sized> Constrain<'missing> for W<A> {}
| ^^^^^^^^ undeclared lifetime
|
help: consider introducing lifetime `'missing` here
|
LL | impl<'missing, A: Sized> Constrain<'missing> for W<A> {}
| +++++++++
error[E0119]: conflicting implementations of trait `Tr<'_>` for type `W<_>`
--> $DIR/dont-canonicalize-re-error.rs:23:1
|
LL | impl<'a, A> Tr<'a> for W<A> {}
| --------------------------- first implementation here
LL | struct W<A>(A);
LL | impl<'a, A> Tr<'a> for A where A: Constrain<'a> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `W<_>`
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0119, E0261.
For more information about an error, try `rustc --explain E0119`.