-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 #92001 - fee1-dead:dmbic-xcrate-fix, r=oli-obk
Fix default_method_body_is_const when used across crates r? `@oli-obk` unblocks #91439.
- Loading branch information
Showing
3 changed files
with
24 additions
and
2 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
3 changes: 3 additions & 0 deletions
3
src/test/ui/rfc-2632-const-trait-impl/auxiliary/cross-crate.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
18 changes: 18 additions & 0 deletions
18
src/test/ui/rfc-2632-const-trait-impl/cross-crate-default-method-body-is-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,18 @@ | ||
// This tests that `default_method_body_is_const` methods can | ||
// be called from a const context when used across crates. | ||
// | ||
// check-pass | ||
|
||
#![feature(const_trait_impl)] | ||
|
||
// aux-build: cross-crate.rs | ||
extern crate cross_crate; | ||
|
||
use cross_crate::*; | ||
|
||
const _: () = { | ||
Const.func(); | ||
Const.defaulted_func(); | ||
}; | ||
|
||
fn main() {} |