Skip to content

Commit

Permalink
Special note for str in auto traits
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Feb 14, 2023
1 parent bf1afe1 commit e9a8ff7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3102,6 +3102,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
self.tcx.def_span(def_id),
"required because it's used within this closure",
),
ty::Str => err.note("`str` is considered to contain a `[u8]` slice for auto trait purposes"),
_ => err.note(&msg),
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0277]: the trait bound `[u8]: AutoTrait` is not satisfied in `str`
LL | needs_auto_trait::<str>();
| ^^^ within `str`, the trait `AutoTrait` is not implemented for `[u8]`
|
= note: required because it appears within the type `str`
= note: `str` is considered to contain a `[u8]` slice for auto trait purposes
note: required by a bound in `needs_auto_trait`
--> $DIR/str-contains-slice-conceptually.rs:8:24
|
Expand Down

0 comments on commit e9a8ff7

Please sign in to comment.