forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
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#97822 - compiler-errors:hesitate-to-suggest…
…-intrinsics, r=oli-obk Filter out intrinsics if we have other import candidates to suggest Fixes rust-lang#97618 Also open to just sorting these candidates to be last. Pretty easy to modify the code to do that, too.
- Loading branch information
Showing
3 changed files
with
48 additions
and
1 deletion.
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,10 @@ | ||
fn main() { | ||
// Should suggest only `std::mem::size_of` | ||
let _ = size_of::<usize>(); | ||
//~^ ERROR cannot find | ||
|
||
// Should suggest `std::intrinsics::fabsf64`, | ||
// since there is no non-intrinsic to suggest. | ||
let _ = fabsf64(1.0); | ||
//~^ ERROR cannot find | ||
} |
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,25 @@ | ||
error[E0425]: cannot find function `size_of` in this scope | ||
--> $DIR/filter-intrinsics.rs:3:13 | ||
| | ||
LL | let _ = size_of::<usize>(); | ||
| ^^^^^^^ not found in this scope | ||
| | ||
help: consider importing this function | ||
| | ||
LL | use std::mem::size_of; | ||
| | ||
|
||
error[E0425]: cannot find function `fabsf64` in this scope | ||
--> $DIR/filter-intrinsics.rs:8:13 | ||
| | ||
LL | let _ = fabsf64(1.0); | ||
| ^^^^^^^ not found in this scope | ||
| | ||
help: consider importing this function | ||
| | ||
LL | use std::intrinsics::fabsf64; | ||
| | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0425`. |