forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#125416 - compiler-errors:param-env-missing-…
…copy, r=lcnr Use correct param-env in `MissingCopyImplementations` We shouldn't assume the param-env is empty for this lint, since although we check the struct has no parameters, there still may be trivial where-clauses. fixes rust-lang#125394
- Loading branch information
Showing
2 changed files
with
25 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//@ check-pass | ||
|
||
#![feature(trivial_bounds)] | ||
#![allow(trivial_bounds)] | ||
|
||
// Make sure that we still use the where-clauses from the struct when checking | ||
// if it may implement `Copy` unconditionally. | ||
// Fix for <https://github.com/rust-lang/rust/issues/125394>. | ||
|
||
pub trait Foo { | ||
type Assoc; | ||
} | ||
|
||
pub struct Bar; | ||
|
||
// This needs to be public | ||
pub struct Baz2(<Bar as Foo>::Assoc) | ||
where | ||
Bar: Foo; | ||
|
||
fn main() {} |