-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #116885 - aliemjay:rollup-plbeppt, r=aliemjay
Rollup of 5 pull requests Successful merges: - #116812 (Disable missing_copy_implementations lint on non_exhaustive types) - #116856 (Disable effects in libcore again) - #116865 (Suggest constraining assoc types in more cases) - #116870 (Don't compare host param by name) - #116879 (revert #114586) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
21 changed files
with
272 additions
and
140 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
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
tests/ui/associated-type-bounds/suggest-contraining-assoc-type-because-of-assoc-const.fixed
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 @@ | ||
// run-rustfix | ||
trait O { | ||
type M; | ||
} | ||
trait U<A: O> { | ||
const N: A::M; | ||
} | ||
impl<D> O for D { | ||
type M = u8; | ||
} | ||
impl<C: O<M = u8>> U<C> for u16 { | ||
const N: C::M = 4u8; //~ ERROR mismatched types | ||
} | ||
fn main() {} |
14 changes: 14 additions & 0 deletions
14
tests/ui/associated-type-bounds/suggest-contraining-assoc-type-because-of-assoc-const.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,14 @@ | ||
// run-rustfix | ||
trait O { | ||
type M; | ||
} | ||
trait U<A: O> { | ||
const N: A::M; | ||
} | ||
impl<D> O for D { | ||
type M = u8; | ||
} | ||
impl<C: O> U<C> for u16 { | ||
const N: C::M = 4u8; //~ ERROR mismatched types | ||
} | ||
fn main() {} |
16 changes: 16 additions & 0 deletions
16
tests/ui/associated-type-bounds/suggest-contraining-assoc-type-because-of-assoc-const.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,16 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/suggest-contraining-assoc-type-because-of-assoc-const.rs:12:21 | ||
| | ||
LL | const N: C::M = 4u8; | ||
| ^^^ expected associated type, found `u8` | ||
| | ||
= note: expected associated type `<C as O>::M` | ||
found type `u8` | ||
help: consider constraining the associated type `<C as O>::M` to `u8` | ||
| | ||
LL | impl<C: O<M = u8>> U<C> for u16 { | ||
| ++++++++ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
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,11 @@ | ||
//! Ensure we don't allow accessing const effect parameters from stable Rust. | ||
fn main() { | ||
i8::checked_sub::<true>(42, 43); | ||
//~^ ERROR: method takes 0 generic arguments but 1 generic argument was supplied | ||
} | ||
|
||
const FOO: () = { | ||
i8::checked_sub::<false>(42, 43); | ||
//~^ ERROR: method takes 0 generic arguments but 1 generic argument was supplied | ||
}; |
Oops, something went wrong.