Commit Graph

162277 Commits

Author SHA1 Message Date
David Tolnay
857ea1e7eb
Touch up PR 92899 Iterator::zip docs 2022-01-27 12:41:03 -08:00
Nicholas Nethercote
6035487715 Clarify ArenaAllocatable's second parameter.
It's simply a binary thing to allow different behaviour for `Copy` vs
`!Copy` types. The new code makes this much clearer; I was scratching my
head over the old code for some time.
2022-01-28 07:37:10 +11:00
Nicholas Nethercote
9065c7ced6 Add some comments. 2022-01-28 07:37:07 +11:00
Jubilee Young
e96159e9af pub use std::simd::StdFloat;
Make available the remaining float intrinsics that require runtime support
from a platform's libm, and thus cannot be included in a no-deps libcore,
by exposing them through a sealed trait, `std::simd::StdFloat`.

We might use the trait approach a bit more in the future, or maybe not.
Ideally, this trait doesn't stick around, even if so.
If we don't need to intermesh it with std, it can be used as a crate,
but currently that is somewhat uncertain.
2022-01-27 11:50:58 -08:00
Jubilee Young
cde7bdc678 Sync rust-lang/portable-simd@03f6fbb21e 2022-01-27 11:23:40 -08:00
Maybe Waffle
4ca56d2888 Check that #[rustc_must_implement_one_of] is applied to a trait 2022-01-27 22:07:16 +03:00
Jubilee Young
03f6fbb21e Omit Simd::cast during bootstrap 2022-01-27 10:59:23 -08:00
Michael Woerister
d33e317a72 [debuginfo] Fix and unify handling of fat pointers in debuginfo: Change doc comment so it is not interpreted as doc-test. 2022-01-27 16:55:48 +01:00
kadmin
1c4fe64bdc Continue work on assoc const eq 2022-01-27 14:40:55 +00:00
flip1995
cce9231c19
Merge commit 'a98e7ab8b94485be6bd03e0c6b8682ecab5b52e6' into clippyup 2022-01-27 15:12:45 +01:00
Kvicii
db097f308a fix typo documenation 2022-01-27 22:07:17 +08:00
bors
a98e7ab8b9 Auto merge of #8359 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

changelog: none
2022-01-27 13:48:23 +00:00
Camille GILLOT
a0bcce4884
Store def_id_to_hir_id as variant in hir_owner.
If hir_owner is Owner(_), the LocalDefId is pointing to an owner, so the ItemLocalId is 0.
If the HIR node does not exist, we store Phantom.
Otherwise, we store the HirId associated to the LocalDefId.
2022-01-27 10:46:40 -03:00
flip1995
b96e76869d
Bump nightly version -> 2022-01-27 2022-01-27 14:23:42 +01:00
flip1995
d037b28025
Merge remote-tracking branch 'upstream/master' into rustup 2022-01-27 14:23:31 +01:00
Michael Woerister
3c61d2e172 [debuginfo] Fix and unify handling of fat pointers in debuginfo: Fix some debuginfo tests for old GDB versions and 32-bit targets. 2022-01-27 11:45:45 +01:00
lcnr
2684dfe583 try apply rustc_pass_by_value to Span 2022-01-27 11:29:41 +01:00
Thomas de Zeeuw
4acb8ac46c Use sockaddr_un in unix SocketAddr::from_path 2022-01-27 09:54:28 +01:00
Thomas de Zeeuw
ca9a3c9a9f Make sockaddr_un safe and use copy_nonoverlapping
The creation of libc::sockaddr_un is a safe operation, no need for it to
be unsafe.

This also uses the more performant copy_nonoverlapping instead of an
iterator.
2022-01-27 09:52:59 +01:00
lcnr
e6808381e5 update pass_by_value 2022-01-27 07:58:33 +01:00
cameron
f27758e8d7 mention std::iter::zip in Iterator::zip docs 2022-01-27 06:47:52 +00:00
Michael Goulet
c6f6e3e0e9 do not register infer var for GAT projection in opaque 2022-01-26 22:45:12 -08:00
Nicholas Nethercote
696d5034b2 Clarify the usage-of-qualified-ty error message.
I found this message confusing when I encountered it. This commit makes
it clearer that you have to import the unqualified type yourself.
2022-01-27 17:42:35 +11:00
bors
21b4a9cfdc Auto merge of #92889 - tmiasko:unbounded-recursion, r=ecstatic-morse
Ignore unwinding edges when checking for unconditional recursion

The unconditional recursion lint determines if all execution paths
eventually lead to a self-recursive call.

The implementation always follows unwinding edges which limits its
practical utility. For example, it would not lint function `f` because a
call to `g` might unwind. It also wouldn't lint function `h` because an
overflow check preceding the self-recursive call might unwind:

```rust
pub fn f() {
    g();
    f();
}

pub fn g() { /* ... */ }

pub fn h(a: usize) {
  h(a + 1);
}
```

To avoid the issue, assume that terminators that might continue
execution along non-unwinding edges do so.

Fixes #78474.
2022-01-27 06:21:53 +00:00
Jubilee
7072c2278e
Merge portable-simd#232 - ./feat/typecast
Add Simd::cast
Add core_simd/tests/cast.rs
2022-01-26 22:21:00 -08:00
Jubilee Young
0031b02cee Add core_simd/tests/cast.rs 2022-01-26 21:04:47 -08:00
Michael Goulet
c6de4d55aa drive-by: use is_const and is_const_if_const 2022-01-26 19:24:01 -08:00
Michael Goulet
1ab97dbc52 add note suggesting that predicate is satisfied but is not const 2022-01-26 19:09:44 -08:00
Jubilee Young
a991d48e95 Add Simd::cast 2022-01-26 18:37:02 -08:00
bors
563250a65c Auto merge of #93081 - nikic:aarch64-fix, r=cuviper
Update LLVM submodule

Update LLVM to fix #92786.
2022-01-27 01:53:24 +00:00
bors
009c1d0248 Auto merge of #93352 - matthiaskrgr:rollup-5peret4, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #90247 (Improve Duration::try_from_secs_f32/64 accuracy by directly processing exponent and mantissa)
 - #91861 (Replace iterator-based construction of collections by `Into<T>`)
 - #92098 (add OpenBSD platform-support page)
 - #92134 (Add x86_64-pc-windows-msvc linker-plugin-lto instructions)
 - #92256 (Improve selection errors for `~const` trait bounds)
 - #92778 (fs: Use readdir() instead of readdir_r() on Linux and Android)
 - #93338 (Update minifier crate version to 0.0.42)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-01-26 22:54:26 +00:00
Michael Watzko
a6c0a3d9c2 Unimpl {Add,Sub,Mul,Div,Rem,BitXor,BitOr,BitAnd}<$t> for Saturating<$t>
Analog to 9648b313cc #93208
2022-01-26 23:49:54 +01:00
Matthias Krüger
4276626299
Rollup merge of #93338 - GuillaumeGomez:update-minifier, r=notriddle
Update minifier crate version to 0.0.42

Some issues on the CSS minification.

r? `@notriddle`
2022-01-26 23:45:24 +01:00
Matthias Krüger
253f64c9c6
Rollup merge of #92778 - tavianator:linux-readdir-no-r, r=joshtriplett
fs: Use readdir() instead of readdir_r() on Linux and Android

See #40021 for more details.  Fixes #86649.  Fixes #34668.
2022-01-26 23:45:23 +01:00
Matthias Krüger
e2b2bfe10c
Rollup merge of #92256 - fee1-dead:improve-selection-err, r=oli-obk
Improve selection errors for `~const` trait bounds
2022-01-26 23:45:22 +01:00
Matthias Krüger
e249812597
Rollup merge of #92134 - nico-abram:patch-1, r=michaelwoerister
Add x86_64-pc-windows-msvc linker-plugin-lto instructions

I had some trouble getting cross language LTO working for this target, in part because the very few links of documentation I could find were linux-centric and because of a few very specific errors I ran into. I'm not sure if this is the correct place to document this, but this is one of the first links I found when looking for documentation so it might be the best place for it.
2022-01-26 23:45:21 +01:00
Matthias Krüger
75eb96301d
Rollup merge of #92098 - semarie:openbsd-platform, r=pietroalbini
add OpenBSD platform-support page

It mentions x86_64, i686, aarch64 and sparc64 which are actively maintained and used on OpenBSD (binaries provided by standard package distribution on OpenBSD).

I volontary kept `powerpc-unknown-openbsd` unmentioned as it was added by `@Yn0ga` in #82733, and I am unaware if it is functional or not (I doubt as I added libc support only few days ago, and std `c_char` signess was wrong). `@Yn0ga` maybe you comment on your `powerpc-unknown-openbsd` usage ?
2022-01-26 23:45:20 +01:00
Matthias Krüger
1dd0ac1f6a
Rollup merge of #91861 - juniorbassani:use-from-array-in-collections-examples, r=yaahc
Replace iterator-based construction of collections by `Into<T>`

Just a few quality of life improvements in the doc examples. I also removed some `Vec`s in favor of arrays.
2022-01-26 23:45:19 +01:00
Matthias Krüger
faf2b7f455
Rollup merge of #90247 - newpavlov:duration_float_fract, r=nagisa
Improve Duration::try_from_secs_f32/64 accuracy by directly processing exponent and mantissa

Closes: #90225

The methods now implement direct processing of exponent and mantissa, which should result in the best possible conversion accuracy (modulo truncation, i.e. float value of 19.995 ns will be represented as 19 ns).
2022-01-26 23:45:18 +01:00
Maybe Waffle
9c8cd1ff37 Add a test for char::DecodeUtf16::size_hint 2022-01-27 00:50:34 +03:00
Maybe Waffle
cd4245d318 Make char::DecodeUtf16::size_hist more precise
New implementation takes into account contents of `self.buf` and rounds
lower bound up instead of down.
2022-01-27 00:30:33 +03:00
Michael Howell
f5cdfb47e5 rustdoc: add test case for multiple traits and erased names
https://github.com/rust-lang/rust/pull/92339#discussion_r792805289
2022-01-26 13:03:31 -07:00
bors
6abb6385b2 Auto merge of #93301 - spastorino:perf-test-1, r=oli-obk
Store hir_id_to_def_id in OwnerInfo.

This is for perf test purposes only. Related to #89278
2022-01-26 19:45:09 +00:00
bors
ea4db3a6c6 Auto merge of #8350 - dswij:8331, r=Manishearth
fix bad suggestion on `numeric_literal`

closes #8331

changelog: [`numeric_literal`]  fix suggestion not showing sign
2022-01-26 19:19:28 +00:00
Eric Holk
9f9d82ab57 Change test to check-pass 2022-01-26 10:47:13 -08:00
Rémy Rakic
644c22d3ad Only traverse attrs once while checking for coherence override 2022-01-26 18:32:02 +01:00
Guillaume Gomez
91f39315e8 Update minifier crate version to 0.0.42 2022-01-26 17:24:34 +01:00
Santiago Pastorino
384189c3d9
Filter out local_id == 0, those are already considered on the call site 2022-01-26 12:25:31 -03:00
Camille GILLOT
14a64e0a55
Bless incremental tests. 2022-01-26 12:25:30 -03:00
Артём Павлов [Artyom Pavlov]
e0bcf771d6 Improve Duration::try_from_secs_f32/64 accuracy by directly processing exponent and mantissa 2022-01-26 18:14:25 +03:00