-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move check for error in impl header outside of reporting
- Loading branch information
1 parent
1447f9d
commit c5a1a67
Showing
3 changed files
with
37 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
tests/ui/traits/next-solver/coherence/skip-reporting-if-references-err.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//@ compile-flags: -Znext-solver | ||
|
||
trait ToUnit<'a> { | ||
type Unit; | ||
} | ||
|
||
impl<T> ToUnit for *const T {} | ||
//~^ ERROR implicit elided lifetime not allowed here | ||
|
||
trait Overlap<T> {} | ||
|
||
impl<T> Overlap<T> for T {} | ||
impl<T> Overlap<for<'a> fn(<*const T as ToUnit<'a>>::Unit)> for T {} | ||
|
||
fn main() {} |
17 changes: 17 additions & 0 deletions
17
tests/ui/traits/next-solver/coherence/skip-reporting-if-references-err.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
error[E0726]: implicit elided lifetime not allowed here | ||
--> $DIR/skip-reporting-if-references-err.rs:7:9 | ||
| | ||
LL | impl<T> ToUnit for *const T {} | ||
| ^^^^^^ expected lifetime parameter | ||
| | ||
help: indicate the anonymous lifetime | ||
| | ||
LL | impl<T> ToUnit<'_> for *const T {} | ||
| ++++ | ||
|
||
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, '^0.Named(DefId(0:14 ~ skip_reporting_if_references_err[c8da]::{impl#2}::'a), "'a")], def_id: DefId(0:5 ~ skip_reporting_if_references_err[c8da]::ToUnit::Unit) } | ||
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, '^0.Named(DefId(0:14 ~ skip_reporting_if_references_err[c8da]::{impl#2}::'a), "'a")], def_id: DefId(0:5 ~ skip_reporting_if_references_err[c8da]::ToUnit::Unit) } | ||
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, '^0.Named(DefId(0:14 ~ skip_reporting_if_references_err[c8da]::{impl#2}::'a), "'a")], def_id: DefId(0:5 ~ skip_reporting_if_references_err[c8da]::ToUnit::Unit) } | ||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0726`. |