Do not suppress the fn item uniqueness note for late bound lifetimes - #161894
Conversation
|
r? @nnethercote rustbot has assigned @nnethercote. Use Why was this reviewer chosen?The reviewer was selected based on:
|
There was a problem hiding this comment.
Suggestion for next time: when doing error message improvements it's nice to add the new test in a first commit, and then make the error message change in the second commit. That way it's easy for the reviewer to see exactly how the error message changed.
| || !found_sig.is_suggestable(self.tcx, true) | ||
| || !expected_sig.is_suggestable(self.tcx, true) | ||
| || self.tcx.intrinsic(*did1).is_some() | ||
| || self.tcx.intrinsic(*did2).is_some() |
There was a problem hiding this comment.
Should this condition be updated to use expected_sig_anon and found_sign_anon?
There was a problem hiding this comment.
I tried, it makes the as fn(..) help trigger and then prints as fn(&'^0.Named(DefId(0:6 ~ lt[99a7]::f1::'a)) A) which looks like a separate pre existing issue with that help, so I left it as is.
|
This seems reasonable to me, modulo the mentioned nit. But anything involving r? types |
e378b8a to
21228c2
Compare
|
Splitted as suggested @rustbot ready |
|
ping @jackh726 |
|
@bors r+ |
…-145558, r=jackh726 Do not suppress the fn item uniqueness note for late bound lifetimes Fixes rust-lang#145558 `same_type_modulo_infer` compared the bound regions by identity, so the note was suppressed for late bound lifetimes and anonymizing the binders fixes it.
Rollup of 13 pull requests Successful merges: - #158515 (Make let-else respect macro_rules expr metavariable grouping) - #160097 (fix const_item_mutation lint to use needs_drop instead of has_dtor) - #161435 (Provide a `supertrait_def_ids()` function in rustc_type_ir's interner) - #161894 (Do not suppress the fn item uniqueness note for late bound lifetimes) - #162990 (post GH comment on types nominations) - #154665 (add safety section for mem::zeroed) - #162700 ( Remove incorrect parse error recovery code that mistakes `as` casts for the long removed type ascription) - #162705 (Trigger "C array" parse error recovery in far fewer cases) - #162875 (Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt) - #162988 (recover `true` and `false` in type position as `bool`) - #162995 (Constify `impl FromStr for NonZero<T>`) - #163006 (Use `end_point` for trailing brace in `let...else` diagnostics) - #163007 (add Dir::try_clone)
…-145558, r=jackh726 Do not suppress the fn item uniqueness note for late bound lifetimes Fixes rust-lang#145558 `same_type_modulo_infer` compared the bound regions by identity, so the note was suppressed for late bound lifetimes and anonymizing the binders fixes it.
…uwer Rollup of 15 pull requests Successful merges: - #158515 (Make let-else respect macro_rules expr metavariable grouping) - #162726 (std: fix unix socket address panic on a full sun_path) - #160028 (Better account for `Self` that might be a typo of `self`) - #160097 (fix const_item_mutation lint to use needs_drop instead of has_dtor) - #161435 (Provide a `supertrait_def_ids()` function in rustc_type_ir's interner) - #161894 (Do not suppress the fn item uniqueness note for late bound lifetimes) - #162990 (post GH comment on types nominations) - #154665 (add safety section for mem::zeroed) - #162700 ( Remove incorrect parse error recovery code that mistakes `as` casts for the long removed type ascription) - #162705 (Trigger "C array" parse error recovery in far fewer cases) - #162875 (Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt) - #162988 (recover `true` and `false` in type position as `bool`) - #162995 (Constify `impl FromStr for NonZero<T>`) - #163006 (Use `end_point` for trailing brace in `let...else` diagnostics) - #163007 (add Dir::try_clone)
Rollup of 17 pull requests Successful merges: - #158515 (Make let-else respect macro_rules expr metavariable grouping) - #160028 (Better account for `Self` that might be a typo of `self`) - #160097 (fix const_item_mutation lint to use needs_drop instead of has_dtor) - #161435 (Provide a `supertrait_def_ids()` function in rustc_type_ir's interner) - #161894 (Do not suppress the fn item uniqueness note for late bound lifetimes) - #162990 (post GH comment on types nominations) - #153662 (Suggest fully qualified path on method name collision) - #154665 (add safety section for mem::zeroed) - #159787 (Prefer ModId in more places) - #162700 ( Remove incorrect parse error recovery code that mistakes `as` casts for the long removed type ascription) - #162705 (Trigger "C array" parse error recovery in far fewer cases) - #162875 (Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt) - #162988 (recover `true` and `false` in type position as `bool`) - #162995 (Constify `impl FromStr for NonZero<T>`) - #163006 (Use `end_point` for trailing brace in `let...else` diagnostics) - #163007 (add Dir::try_clone) - #163039 (Use verbose suggestion for parenthetical `Fn` notation and fully-qualified path on ambiguous assoc item)
Rollup of 17 pull requests Successful merges: - #158515 (Make let-else respect macro_rules expr metavariable grouping) - #160028 (Better account for `Self` that might be a typo of `self`) - #160097 (fix const_item_mutation lint to use needs_drop instead of has_dtor) - #161435 (Provide a `supertrait_def_ids()` function in rustc_type_ir's interner) - #161894 (Do not suppress the fn item uniqueness note for late bound lifetimes) - #162990 (post GH comment on types nominations) - #153662 (Suggest fully qualified path on method name collision) - #154665 (add safety section for mem::zeroed) - #159787 (Prefer ModId in more places) - #162700 ( Remove incorrect parse error recovery code that mistakes `as` casts for the long removed type ascription) - #162705 (Trigger "C array" parse error recovery in far fewer cases) - #162875 (Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt) - #162988 (recover `true` and `false` in type position as `bool`) - #162995 (Constify `impl FromStr for NonZero<T>`) - #163006 (Use `end_point` for trailing brace in `let...else` diagnostics) - #163007 (add Dir::try_clone) - #163039 (Use verbose suggestion for parenthetical `Fn` notation and fully-qualified path on ambiguous assoc item)
Rollup merge of #161894 - zakrad:fix-fn-item-note-late-bound-145558, r=jackh726 Do not suppress the fn item uniqueness note for late bound lifetimes Fixes #145558 `same_type_modulo_infer` compared the bound regions by identity, so the note was suppressed for late bound lifetimes and anonymizing the binders fixes it.
Fixes #145558
same_type_modulo_infercompared the bound regions by identity, so the note was suppressed for late bound lifetimes and anonymizing the binders fixes it.I authored and reviewed the change and used LLM to help locate the code and validate the fix