Skip to content

Commit 62f303e

Browse files
committed
Auto merge of #144058 - matthiaskrgr:rollup-xezozsk, r=matthiaskrgr
Rollup of 11 pull requests Successful merges: - rust-lang/rust#143326 (Remove deprecated `Error::description` impl from `c_str::FromBytesWithNulError`) - rust-lang/rust#143431 (Use relative visibility when noting sealed trait to reduce false positive) - rust-lang/rust#143550 (resolve: Use interior mutability for extern module map) - rust-lang/rust#143631 (update to literal-escaper-0.0.5) - rust-lang/rust#143793 (Opaque type collection: Guard against endlessly recursing free alias types) - rust-lang/rust#143880 (tests: Test line debuginfo for linebreaked function parameters) - rust-lang/rust#143914 (Reword mismatched-lifetime-syntaxes text based on feedback) - rust-lang/rust#143926 (Remove deprecated fields in bootstrap) - rust-lang/rust#143955 (Make frame spans appear on a separate trace line) - rust-lang/rust#143975 (type_id_eq: check that the hash fully matches the type) - rust-lang/rust#143984 (Fix ice for feature-gated `cfg` attributes applied to the crate) r? `@ghost` `@rustbot` modify labels: rollup
2 parents b360561 + fd25218 commit 62f303e

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

tests/ui/ptr_arg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ mod issue_9218 {
312312

313313
// Inferred to be `&'a str`, afaik.
314314
fn cow_good_ret_ty<'a>(input: &'a Cow<'a, str>) -> &str {
315-
//~^ ERROR: lifetime flowing from input to output with different syntax
315+
//~^ ERROR: eliding a lifetime that's named elsewhere is confusing
316316
todo!()
317317
}
318318
}

tests/ui/ptr_arg.stderr

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,18 +231,19 @@ error: writing `&String` instead of `&str` involves a new object where a slice w
231231
LL | fn good(v1: &String, v2: &String) {
232232
| ^^^^^^^ help: change this to: `&str`
233233

234-
error: lifetime flowing from input to output with different syntax can be confusing
234+
error: eliding a lifetime that's named elsewhere is confusing
235235
--> tests/ui/ptr_arg.rs:314:36
236236
|
237237
LL | fn cow_good_ret_ty<'a>(input: &'a Cow<'a, str>) -> &str {
238-
| ^^ ^^ ---- the lifetime gets resolved as `'a`
238+
| ^^ ^^ ---- the same lifetime is elided here
239239
| | |
240-
| | these lifetimes flow to the output
241-
| these lifetimes flow to the output
240+
| | the lifetime is named here
241+
| the lifetime is named here
242242
|
243+
= help: the same lifetime is referred to in inconsistent ways, making the signature confusing
243244
= note: `-D mismatched-lifetime-syntaxes` implied by `-D warnings`
244245
= help: to override `-D warnings` add `#[allow(mismatched_lifetime_syntaxes)]`
245-
help: one option is to consistently use `'a`
246+
help: consistently use `'a`
246247
|
247248
LL | fn cow_good_ret_ty<'a>(input: &'a Cow<'a, str>) -> &'a str {
248249
| ++

0 commit comments

Comments
 (0)