| Age | Commit message (Collapse) | Author | Lines |
|
|
|
This PR adds `memchr`and `memrchr` based on @BurntSushi 's rust-memchr crate to libstd (as discussed in #30151).
I've update some places in libstd to use memchr/memrchr, but I am not sure if there are other places where it could be used as well.
ref #30076
|
|
|
|
|
|
|
|
|
|
Reported by Sebastien Marie.
|
|
I copied it from the getrandom code but forgot to change the name.
Reported by Sebastien Marie.
|
|
Rust already supports Linux's getrandom(2), which is very similar and
was based on getentropy(2). This is a pretty clean, simple addition that
uses the same approach as the iOS randomness API support.
|
|
One will look at graphviz often when working with MIR, so may as well make the tables a bit more
pretty :)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Make RFC 1214 warnings into errors, and rip out the "warn or err"
associated machinery. Future such attempts should go through lints
anyhow.
There is a fair amount of fallout in the compile-fail tests, as WF
checking now occurs earlier in the process.
r? @arielb1
|
|
This adds a constructor for a Weak that can never be upgraded. These are
mostly useless, but for example are required when deserializing.
|
|
Some notes:
This patch enforces the rules from [RFC 136](https://github.com/rust-lang/rfcs/blob/master/text/0136-no-privates-in-public.md) and makes "private in public" a module-level concept and not crate-level. Only `pub` annotations are used by the new algorithm, crate-level exported node set produced by `EmbargoVisitor` is not used. The error messages are tweaked accordingly and don't use the word "exported" to avoid confusing people (https://github.com/rust-lang/rust/issues/29668).
The old algorithm tried to be extra smart with impls, but it mostly led to unpredictable behavior and bugs like https://github.com/rust-lang/rust/issues/28325.
The new algorithm tries to be as simple as possible - an impl is considered public iff its type is public and its trait is public (if presents).
A type or trait is considered public if all its components are public, [complications](https://internals.rust-lang.org/t/limits-of-type-inference-smartness/2919) with private types leaking to other crates/modules through trait impls and type inference are deliberately ignored so far.
The new algorithm is not recursive and uses the nice new facility `Crate::visit_all_items`!
Obsolete pre-1.0 feature `visible_private_types` is removed.
This is a [breaking-change].
The two main vectors of breakage are type aliases (https://github.com/rust-lang/rust/issues/28450) and impls (https://github.com/rust-lang/rust/issues/28325).
I need some statistics from a crater run (cc @alexcrichton) to decide on the breakage mitigation strategy.
UPDATE: All the new errors are reported as warnings controlled by a lint `private_in_public` and lint group `future_incompatible`, but the intent is to make them hard errors eventually.
Closes https://github.com/rust-lang/rust/issues/28325
Closes https://github.com/rust-lang/rust/issues/28450
Closes https://github.com/rust-lang/rust/issues/29524
Closes https://github.com/rust-lang/rust/issues/29627
Closes https://github.com/rust-lang/rust/issues/29668
Closes https://github.com/rust-lang/rust/issues/30055
r? @nikomatsakis
|
|
Type aliases are still substituted when determining impl publicity
|
|
associated machinery. Future such attempts should go through lints
anyhow.
There is a fair amount of fallout in the compile-fail tests, as WF
checking now occurs earlier in the process.
|
|
|
|
Fixes #30371.
|
|
+ Rebase fixes
|
|
|
|
|
|
|
|
LLVM doesn't really support reusing the same module to emit more than
one file. One bug this causes is that the IR is invalidated by the stack
coloring pass when emitting the first file, and then the IR verifier
complains by the time we try to emit the second file. Also, we get
different binaries with --emit=asm,link than with just --emit=link. In
some cases leading to segfaults.
Unfortunately, it seems that at this point in time, the most sensible
option to circumvent this problem is to just clone the whole llvm module
for the asm output if we need both, asm and obj file output.
Fixes #24876
Fixes #26235
|
|
Added sentences for description of code and changed x in the example to an int
|
|
Remove a needless variable and simply a cfg().
|
|
Part of https://github.com/rust-lang/rust/pull/30095 not causing mysterious segfaults.
r? @nrc
|
|
|
|
|
|
|
|
previously the error was erased and a `non-const path` error was emitted at the location of the field access instead of at the overflow location (as can be seen in the playground: http://is.gd/EuAF5F )
|
|
The previous example had no chance of compiling in either form, due to the restrictive follow set for `ty`. This one has the desired behavior: http://is.gd/kYdw4g (well, I don't exactly desire this behavior at all, but it's true at least :p )
|
|
This fixes a double word typo, 'the'.
|
|
Should make it possible to add JSON or HTML errors. Also tidies up a lot.
|
|
previously the error was erased and a `non-const path` error was emitted at the location of the field access instead of at the overflow location (as can be seen in the playground: http://is.gd/EuAF5F )
|
|
Second sentence actually repeats info from first sentence. "from start to end" also feels like it adds nothing.
I also extended Vec::drain example.
|
|
Call me verbose, but the existing logic was hideously formatted. The
result still fits in a small terminal. No functional change.
|
|
LLVM doesn't really support reusing the same module to emit more than
one file. One bug this causes is that the IR is invalidated by the stack
coloring pass when emitting the first file, and then the IR verifier
complains by the time we try to emit the second file. Also, we get
different binaries with --emit=asm,link than with just --emit=link. In
some cases leading to segfaults.
Unfortunately, it seems that at this point in time, the most sensible
option to circumvent this problem is to just clone the whole llvm module
for the asm output if we need both, asm and obj file output.
Fixes #24876
Fixes #26235
|
|
Apparently this file's use annotations have changed since I last pulled
on my test machine.
|
|
It returns sizeof(dirent_t), so I'm not sure why its return type is int.
It's only used once, and that usage immediately casts it to usize.
|
|
|
|
|
|
|
|
|