forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
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#127452 - fee1-dead-contrib:fx-intrinsic-cou…
…nting, r=fmease Fix intrinsic const parameter counting with `effects` r? project-const-traits
- Loading branch information
Showing
7 changed files
with
126 additions
and
31 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
52 changes: 52 additions & 0 deletions
52
tests/ui/intrinsics/safe-intrinsic-mismatch.effects.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,52 @@ | ||
error: using `#![feature(effects)]` without enabling next trait solver globally | ||
| | ||
= note: the next trait solver must be enabled globally for the effects feature to work correctly | ||
= help: use `-Znext-solver` to enable | ||
|
||
error: intrinsic safety mismatch between list of intrinsics within the compiler and core library intrinsics for intrinsic `size_of` | ||
--> $DIR/safe-intrinsic-mismatch.rs:11:5 | ||
| | ||
LL | fn size_of<T>() -> usize; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: intrinsic safety mismatch between list of intrinsics within the compiler and core library intrinsics for intrinsic `size_of` | ||
--> $DIR/safe-intrinsic-mismatch.rs:11:5 | ||
| | ||
LL | fn size_of<T>() -> usize; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` | ||
|
||
error: intrinsic safety mismatch between list of intrinsics within the compiler and core library intrinsics for intrinsic `assume` | ||
--> $DIR/safe-intrinsic-mismatch.rs:16:1 | ||
| | ||
LL | const fn assume(_b: bool) {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0308]: intrinsic has wrong type | ||
--> $DIR/safe-intrinsic-mismatch.rs:16:16 | ||
| | ||
LL | const fn assume(_b: bool) {} | ||
| ^ expected unsafe fn, found safe fn | ||
| | ||
= note: expected signature `unsafe fn(_)` | ||
found signature `fn(_)` | ||
|
||
error: intrinsic safety mismatch between list of intrinsics within the compiler and core library intrinsics for intrinsic `const_deallocate` | ||
--> $DIR/safe-intrinsic-mismatch.rs:20:1 | ||
| | ||
LL | const fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0308]: intrinsic has wrong type | ||
--> $DIR/safe-intrinsic-mismatch.rs:20:26 | ||
| | ||
LL | const fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) {} | ||
| ^ expected unsafe fn, found safe fn | ||
| | ||
= note: expected signature `unsafe fn(_, _, _)` | ||
found signature `fn(_, _, _)` | ||
|
||
error: aborting due to 7 previous errors | ||
|
||
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
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
24 changes: 10 additions & 14 deletions
24
tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.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 |
---|---|---|
@@ -1,17 +1,13 @@ | ||
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/minicore.rs:8:30 | ||
| | ||
LL | #![feature(const_trait_impl, effects, const_mut_refs)] | ||
| ^^^^^^^ | ||
| | ||
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
error: the compiler unexpectedly panicked. this is a bug. | ||
|
||
error: requires `EffectsCompat` lang_item | ||
--> $DIR/minicore.rs:455:9 | ||
| | ||
LL | impl<T: Clone> Clone for RefCell<T> { | ||
| ^^^^^ | ||
query stack during panic: | ||
#0 [check_well_formed] checking that `<impl at $DIR/minicore.rs:459:1: 459:36>` is well-formed | ||
#1 [check_mod_type_wf] checking that types are well-formed in top-level module | ||
end of query stack | ||
|
||
error: aborting due to 1 previous error; 1 warning emitted | ||
error: the compiler unexpectedly panicked. this is a bug. | ||
|
||
query stack during panic: | ||
#0 [check_well_formed] checking that `drop` is well-formed | ||
#1 [check_mod_type_wf] checking that types are well-formed in top-level module | ||
end of query stack |