Commit Graph

4852 Commits

Author SHA1 Message Date
bors
3a5c8e91f0 Auto merge of #110393 - fee1-dead-contrib:rm-const-traits, r=oli-obk
Rm const traits in libcore

See [zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/.60const.20Trait.60.20removal.20or.20rework)

* [x] Bless ui tests
* [ ] Re constify some unstable functions with workarounds if they are needed
2023-04-19 13:03:40 +00:00
Matthias Krüger
3320b2a59a
Rollup merge of #110432 - compiler-errors:unsatisfied-index-impl, r=cjgillot
Report more detailed reason why `Index` impl is not satisfied

Fixes #110373
2023-04-19 06:35:34 +02:00
Michael Goulet
d84b5f9b3d Use a diagnostic item instead of filtering for Index::Output 2023-04-18 18:55:17 +00:00
Guillaume Gomez
e6b607335a
Rollup merge of #110441 - kadiwa4:typos, r=thomcc
5 little typos
2023-04-18 14:50:51 +02:00
Deadbeef
dd025c3b56 fix codegen difference 2023-04-17 09:27:07 +00:00
kadiwa
85653831f7
typos 2023-04-17 09:16:07 +02:00
Matthias Krüger
6e9a52cdc0
Rollup merge of #110388 - JohnBobbo96:remove-intrinsic-unwrap, r=the8472
Add a message for if an overflow occurs in `core::intrinsics::is_nonoverlapping`.
2023-04-17 08:09:40 +02:00
John Bobbo
3dba5872a3
Add a message indicating overflow in
`core::intrinsics::is_nonoverlapping`.
2023-04-16 07:35:18 -07:00
Deadbeef
4c6ddc036b fix library and rustdoc tests 2023-04-16 11:38:52 +00:00
Deadbeef
eac922e721 readd const_trait to Drop, Destruct, and Fn* 2023-04-16 09:25:23 +00:00
Deadbeef
34097b2f33 fix tidy 2023-04-16 07:27:28 +00:00
Deadbeef
63e0ddbf1d core is now compilable 2023-04-16 07:20:26 +00:00
Deadbeef
e80c020445 more hacks 2023-04-16 07:20:15 +00:00
Deadbeef
ddc02b0f32 hack cstr is_empty 2023-04-16 07:05:54 +00:00
Deadbeef
d88f979437 hack signum as well 2023-04-16 07:04:17 +00:00
Deadbeef
8cda8df578 memchr hack 2023-04-16 07:00:52 +00:00
Deadbeef
76dbe29104 rm const traits in libcore 2023-04-16 06:49:27 +00:00
est31
77821b2eb9 Remove unused unused_macros
The macro is always used
2023-04-16 08:35:39 +02:00
John Bobbo
d0603fdafa
Use a saturating_mul instead of a checked_mul
and `unwrap` in `core::intrinsics`.
2023-04-15 22:40:26 -07:00
Yuki Okushi
1c228d122f
Rollup merge of #110347 - est31:size_of_links, r=jyn514
Add intra-doc links to size_of_* functions

Also some smaller doc improvements.
2023-04-16 06:55:22 +09:00
est31
504a47b16d Add intra-doc links to size_of_* functions 2023-04-15 14:07:18 +02:00
Matthias Krüger
d5c7237400
Rollup merge of #110244 - kadiwa4:unnecessary_imports, r=JohnTitor
Remove some unneeded imports / qualified paths

Continuation of #105537.
2023-04-14 21:11:13 +02:00
Matthias Krüger
d1c480f986
Rollup merge of #110154 - DaniPopes:library-typos, r=JohnTitor
Fix typos in library

I ran [`typos -w library`](https://github.com/crate-ci/typos) to fix typos in the `library` directory.

Refs #110150
2023-04-14 21:11:12 +02:00
Matthias Krüger
5107c4c556
Rollup merge of #110110 - lukas-code:display-panic-info, r=JohnTitor
Use `Display` in top-level example for `PanicInfo`

Addresses https://github.com/rust-lang/rust/issues/110098.

This confused me as well, when I was writing a `no_std` panic handler for the first time, so here's a better top-level example.

`Display` is stable, prints the `.message()` if available, and falls back to `.payload().downcast_ref<&str>()` if the message is not available. So this example should provide strictly more information and also work for formatted panics.

The old example still exists on the `payload` method.
2023-04-14 21:11:12 +02:00
Matthias Krüger
4b8351f62e
Rollup merge of #109947 - clubby789:cmp-macro-crosslink, r=JohnTitor
Add links from `core::cmp` derives to their traits

Fixes #109946
Adds intra-doc links from the `core::cmp` derives to their respective traits, and a link to their derive behaviour

`@rustbot` label +A-docs
2023-04-14 21:11:11 +02:00
Yuki Okushi
e79fc5b729
Rollup merge of #110269 - scottmcm:sort-features, r=jyn514
Add `tidy-alphabetical` to features in `core`

So that people have to keep them sorted in future, rather than just sticking them on the end where they conflict more often.
2023-04-14 23:00:34 +09:00
bors
3e565f1a27 Auto merge of #101959 - Xaeroxe:clamp-better-assert, r=ChrisDenton
Add better assert messages for f32/f64 clamps
2023-04-14 10:44:36 +00:00
Matthias Krüger
2e39e15e40
Rollup merge of #110158 - TDecking:obsolete_test, r=ChrisDenton
Remove obsolete test case

This test case was supposed to cover issue #31109 at some point.
It never did anything, as the issue was still open at the time of its creation.
When the issue was resolved, the `issue31109` test case was created,
making the existence of this test pointless.
2023-04-14 07:58:39 +02:00
Matthias Krüger
c6223e198d
Rollup merge of #109800 - bryangarza:safe-transmute-improved-errors, r=compiler-errors
Improve safe transmute error reporting

This patch updates the error reporting when Safe Transmute is not possible between 2 types by including the reason.

Also, fix some small bugs that occur when computing the `Answer` for transmutability.
2023-04-14 07:58:39 +02:00
Bryan Garza
36febe1f4d Improve safe transmute error reporting
This patch updates the error reporting when Safe Transmute is not
possible between 2 types by including the reason.

Also, fix some small bugs that occur when computing the `Answer` for
transmutability.
2023-04-13 21:57:08 +00:00
Matthias Krüger
e413c2e770
Rollup merge of #110259 - ndrewxie:issue-109964-fix-gitstuff, r=cjgillot
Added diagnostic for pin! macro in addition to Box::pin if Unpin isn't implemented

I made a PR earlier, but accidentally renamed a branch and that deleted the PR... sorry for the duplicate

Currently, if an operation on `Pin<T>` is performed that requires `T` to implement `Unpin`, the diagnostic suggestion is to use `Box::pin` ("note: consider using `Box::pin`").

This PR suggests pin! as well, as that's another valid way of pinning a value, and avoids a heap allocation. Appropriate diagnostic suggestions were included to highlight the difference in semantics (local pinning for pin! vs non-local for Box::pin).

Fixes #109964
2023-04-13 21:58:37 +02:00
Matthias Krüger
e85ecbbcdc
Rollup merge of #110233 - nbdd0121:intrinsic, r=tmiasko
Make rust-intrinsic ABI unwindable

Fix #104451, fix https://github.com/rust-lang/miri/issues/2839

r? `@RalfJung`
2023-04-13 21:58:37 +02:00
Gary Guo
731c6dcb60 Document catch_fn in r#try cannot unwind 2023-04-13 11:36:22 +01:00
Scott McMurray
74076684a2 Add tidy-alphabetical to features in core
So that people have to keep them sorted in future.
2023-04-13 00:36:40 -07:00
Justin Symonds
9b0ceb4395
Update unwind_safe.rs
Typo in the documentation.
2023-04-12 18:21:56 -07:00
Andrew Xie
9e0e4c31aa Added diagnostic for pin! macro in addition to Box::pin if Unpin isn't implemented 2023-04-12 18:03:11 -04:00
KaDiWa
ad2b34d0e3
remove some unneeded imports 2023-04-12 19:27:18 +02:00
Matthias Krüger
bb037e6fa7
Rollup merge of #110190 - cbeuw:mir-offset, r=oli-obk
Custom MIR: Support `BinOp::Offset`

Since offset doesn't have an infix operator, a new function `Offset` is added which is lowered to `Rvalue::BinaryOp(BinOp::Offset, ..)`

r? ```@oli-obk``` or ```@tmiasko``` or ```@JakobDegen```
2023-04-12 17:04:32 +02:00
Gary Guo
229b0a0fdc Make rust-intrinsic ABI unwindable
Stick `#[rustc_nounwind]` to all except `const_eval_select` to undo the
change for all other intrinsics.
2023-04-12 14:05:05 +01:00
Michael Goulet
4f2f7fda10
Rollup merge of #110104 - kormosi:todo_typo, r=cuviper
Reword the docstring in todo! macro definition, fixing a typo
2023-04-11 20:28:47 -07:00
Patrik Kormosi
4e84d695f3 Reword the docstring in todo! macro definition 2023-04-11 16:29:48 +02:00
Andy Wang
cecb901e68
Add Offset binary op to custom mir 2023-04-11 16:23:35 +02:00
Yuki Okushi
75a46252ba
Rollup merge of #110070 - scottmcm:wrapping-neg, r=cuviper
The `wrapping_neg` example for unsigned types shouldn't use `i8`

Probably it should have at least one example with an unsigned type.
2023-04-11 12:18:51 +09:00
Tobias Decking
65c9c79d3f
remove obsolete test 2023-04-10 21:57:45 +02:00
DaniPopes
a0daf22b95
Fix typos in library 2023-04-10 21:07:29 +02:00
bors
a73288371e Auto merge of #107007 - TDecking:float_parsing_improvments, r=Mark-Simulacrum
Improve the floating point parser in dec2flt.

Greetings everyone,

I've benn studying the rust floating point parser recently and made the following tweaks:

* Remove all remaining traces of `unsafe`. The parser is now 100% safe Rust.
* The trick in which eight digits are processed in parallel is now in a loop.
* Parsing of inf/NaN values has been reworked.

On my system, the changes result in performance improvements for some input values.
2023-04-10 14:09:09 +00:00
Dylan DPC
b6633ffaf7
Rollup merge of #110044 - scottmcm:more-size-of-val, r=ChrisDenton
Avoid some manual slice length calculation

No need for us to write the multiplication when `size_of_val` does exactly what we need.

(https://github.com/rust-lang/rust-clippy/pull/10601)
2023-04-10 14:13:14 +05:30
Tobias Decking
0f96c71792 Improve the floating point parser in dec2flt.
* Remove all remaining traces of unsafe.
* Put `parse_8digits` inside a loop.
* Rework parsing of inf/NaN values.
2023-04-10 00:47:08 +02:00
bors
1c39afb375 Auto merge of #109684 - fee1-dead-contrib:rv_const_range, r=Mark-Simulacrum
Revert #104100, Allow using `Range` as an `Iterator` in const contexts.

This fixes #109632.
2023-04-09 15:42:27 +00:00
Lukas Markeffsky
d9f99c36fe Use Display in top-level example for PanicInfo 2023-04-09 14:29:16 +02:00