-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lint impls that will become incoherent when leak-check is removed
- Loading branch information
1 parent
e9c7894
commit 363faba
Showing
13 changed files
with
166 additions
and
17 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
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
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
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
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
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
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
14 changes: 14 additions & 0 deletions
14
src/test/ui/coherence/coherence-inherited-subtyping.old.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,14 @@ | ||
error[E0592]: duplicate definitions with name `method1` | ||
--> $DIR/coherence-inherited-subtyping.rs:14:5 | ||
| | ||
LL | fn method1(&self) {} | ||
| ^^^^^^^^^^^^^^^^^^^^ duplicate definitions for `method1` | ||
... | ||
LL | fn method1(&self) {} | ||
| -------------------- other definition for `method1` | ||
| | ||
= note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0592`. |
14 changes: 14 additions & 0 deletions
14
src/test/ui/coherence/coherence-inherited-subtyping.re.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,14 @@ | ||
error[E0592]: duplicate definitions with name `method1` | ||
--> $DIR/coherence-inherited-subtyping.rs:14:5 | ||
| | ||
LL | fn method1(&self) {} | ||
| ^^^^^^^^^^^^^^^^^^^^ duplicate definitions for `method1` | ||
... | ||
LL | fn method1(&self) {} | ||
| -------------------- other definition for `method1` | ||
| | ||
= note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0592`. |
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,21 @@ | ||
// Test that two distinct impls which match subtypes of one another | ||
// yield coherence errors (or not) depending on the variance. | ||
// | ||
// Note: This scenario is currently accepted, but as part of the | ||
// universe transition (#56105) may eventually become an error. | ||
|
||
// revisions: old re | ||
|
||
struct Foo<T> { | ||
t: T, | ||
} | ||
|
||
impl Foo<for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8> { | ||
fn method1(&self) {} //~ ERROR duplicate definitions with name `method1` | ||
} | ||
|
||
impl Foo<for<'a> fn(&'a u8, &'a u8) -> &'a u8> { | ||
fn method1(&self) {} | ||
} | ||
|
||
fn main() {} |
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,16 @@ | ||
error: conflicting implementations of trait `TheTrait` for type `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`: | ||
--> $DIR/coherence-subtyping.rs:15:1 | ||
| | ||
LL | impl TheTrait for for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8 {} | ||
| ---------------------------------------------------------- first implementation here | ||
LL | | ||
LL | impl TheTrait for for<'a> fn(&'a u8, &'a u8) -> &'a u8 { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8` | ||
| | ||
= note: `#[deny(coherence_leak_check)]` on by default | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105> | ||
= note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details | ||
|
||
error: aborting due to previous error | ||
|
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,16 @@ | ||
error: conflicting implementations of trait `TheTrait` for type `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`: | ||
--> $DIR/coherence-subtyping.rs:15:1 | ||
| | ||
LL | impl TheTrait for for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8 {} | ||
| ---------------------------------------------------------- first implementation here | ||
LL | | ||
LL | impl TheTrait for for<'a> fn(&'a u8, &'a u8) -> &'a u8 { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8` | ||
| | ||
= note: `#[deny(coherence_leak_check)]` on by default | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105> | ||
= note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details | ||
|
||
error: aborting due to previous error | ||
|
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