| Age | Commit message (Collapse) | Author | Lines |
|
`File::options().read(true).open(...)` is equivalent to just
`File::open`. Change the example to set the `append` flag instead, and
then change the filename to something more likely to be written in
append mode.
|
|
Rollup of 7 pull requests
Successful merges:
- #92248 (Normalize struct tail type when checking Pointee trait)
- #92357 (Fix invalid removal of newlines from doc comments)
- #92602 (Make source links look cleaner)
- #92636 (Normalize generator-local types with unevaluated constants)
- #92693 (Release notes: add `Result::unwrap_{,err_}unchecked`)
- #92702 (Clean up lang_items::extract)
- #92717 (update miri)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
update miri
Fixes https://github.com/rust-lang/rust/issues/92691
r? `@ghost`
|
|
Clean up lang_items::extract
Noted in https://github.com/rust-lang/rust/pull/87739#pullrequestreview-740497194,
lang_items::extract no longer needs to take a closure.
|
|
Release notes: add `Result::unwrap_{,err_}unchecked`
They were stabilized together with `Option::unwrap_unchecked`
in https://github.com/rust-lang/rust/issues/81383.
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
|
|
r=oli-obk
Normalize generator-local types with unevaluated constants
Normalize generator-interior types in addition to (i.e. instead of just) erasing regions, since sometimes we collect types with unevaluated const exprs.
Fixes #84737
Fixes #88171
Fixes #92091
Fixes #92634
Probably also fixes #73114, but that one has no code I could test. It looks like it's the same issue, though.
|
|
Make source links look cleaner
Change from syntaxy-looking [src] to the plain word "source".
Change the syntaxy-looking `[-]` at the top of the page to say "collapse".
Reduce opacity of rightside content.
Part of #59851
r? `@GuillaumeGomez`
Demo: https://rustdoc.crud.net/jsha/source-link-2/std/string/struct.String.html
[Discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/display.20of.20source.20link).
|
|
r=camelid
Fix invalid removal of newlines from doc comments
Fixes https://github.com/rust-lang/rust/issues/91201.
Before:

After:

r? `@camelid`
|
|
Normalize struct tail type when checking Pointee trait
Let's go ahead and implement the FIXMEs by properly normalizing the struct-tail type when satisfying a Pointee obligation. This should fix the ICE when we try to calculate a layout depending on `<Ty as Pointee>::Metadata` later.
Fixes #92128
Fixes #92577
Additionally, mark the obligation as ambiguous if there are any infer types in that struct-tail type. This has the effect of causing `<_ as Pointee>::Metadata` to be properly replaced with an infer variable ([here](https://github.com/rust-lang/rust/blob/master/compiler/rustc_trait_selection/src/traits/project.rs#L813)) and registered as an obligation... this turns out to be very important in unifying function parameters with formals that are assoc types.
Fixes #91446
|
|
|
|
Fixes wrong unreachable_pub lints on nested and glob public reexport
Linked issues: #64762 & #82064
|
|
Ensure that `Fingerprint` caching respects hashing configuration
Fixes #92266
In some `HashStable` impls, we use a cache to avoid re-computing
the same `Fingerprint` from the same structure (e.g. an `AdtDef`).
However, the `StableHashingContext` used can be configured to
perform hashing in different ways (e.g. skipping `Span`s). This
configuration information is not included in the cache key,
which will cause an incorrect `Fingerprint` to be used if
we hash the same structure with different `StableHashingContext`
settings.
To fix this, the configuration settings of `StableHashingContext`
are split out into a separate `HashingControls` struct. This
struct is used as part of the cache key, ensuring that our caches
always produce the correct result for the given settings.
With this in place, we now turn off `Span` hashing during the
entire process of computing the hash included in legacy symbols.
This current has no effect, but will matter when a future PR
starts hashing more `Span`s that we currently skip.
|
|
Noted in https://github.com/rust-lang/rust/pull/87739#pullrequestreview-740497194,
lang_items::extract no longer needs to take a closure.
|
|
Mak DefId to AccessLevel map in resolve for export
hir_id to accesslevel in resolve and applied in privacy
using local def id
removing tracing probes
making function not recursive and adding comments
Move most of Exported/Public res to rustc_resolve
moving public/export res to resolve
fix missing stability attributes in core, std and alloc
move code to access_levels.rs
return for some kinds instead of going through them
Export correctness, macro changes, comments
add comment for import binding
add comment for import binding
renmae to access level visitor, remove comments, move fn as closure, remove new_key
fmt
fix rebase
fix rebase
fmt
fmt
fix: move macro def to rustc_resolve
fix: reachable AccessLevel for enum variants
fmt
fix: missing stability attributes for other architectures
allow unreachable pub in rustfmt
fix: missing impl access level + renaming export to reexport
Missing impl access level was found thanks to a test in clippy
|
|
They were stabilized together with `Option::unwrap_unchecked`
in https://github.com/rust-lang/rust/issues/81383.
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
|
|
Hash `Ident` spans in all HIR structures
This PR removes all of the `#[stable_hasher(project(name))]`
attributes used in HIR structs. While these attributes are not known
to be causing any issues in practice, we need to hash these in
order for the incremental system to work correctly -
a query could be otherwise be incorrectly marked green
when a change occures in one of the `Span`s that it uses.
|
|
Rollup of 8 pull requests
Successful merges:
- #92055 (Add release notes for 1.58)
- #92490 (Move crate drop-down to search results page)
- #92510 (Don't resolve blocks in foreign functions)
- #92573 (expand: Refactor InvocationCollector visitor for better code reuse)
- #92608 (rustdoc: Introduce a resolver cache for sharing data between early doc link resolution and later passes)
- #92657 (Implemented const casts of raw pointers)
- #92671 (Make `Atomic*::from_mut` return `&mut Atomic*`)
- #92673 (Remove useless collapse toggle on "all items" page)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Remove useless collapse toggle on "all items" page
When clicking on this toggle, nothing happens because there is nothing to collapse. Instead of keeping it around, let's just remove it.
Before:

After:

r? `@jsha`
|
|
Make `Atomic*::from_mut` return `&mut Atomic*`
```rust
impl Atomic* {
pub fn from_mut(v: &mut bool) -> &mut Self;
// ^^^^---- previously was just a &
}
```
This PR makes `from_mut` atomic methods tracked in #76314 return unique references to atomic types, instead of shared ones. This makes `from_mut` and `get_mut` inverses of each other, allowing to undo either of them by the other.
r? `@RalfJung`
(as Ralf was [concerned](https://github.com/rust-lang/rust/issues/76314#issuecomment-955062593) about this)
|
|
Implemented const casts of raw pointers
This adds `as_mut()` method for `*const T` and `as_const()` for `*mut T`
which are intended to make casting of consts safer. This was discussed
in the [internals discussion][discussion].
Given that this is a simple change and multiple people agreed to it including `@RalfJung` I decided to go ahead and open the PR.
[discussion]: https://internals.rust-lang.org/t/casting-constness-can-be-risky-heres-a-simple-fix/15933
|
|
rustdoc: Introduce a resolver cache for sharing data between early doc link resolution and later passes
The refactoring parts of https://github.com/rust-lang/rust/pull/88679, shouldn't cause any slowdowns.
r? `@jyn514`
|
|
expand: Refactor InvocationCollector visitor for better code reuse
The refactoring part of https://github.com/rust-lang/rust/pull/92473.
Invocation collector visitor logic now lives in two main functions:
- `fn flat_map_node`, corresponding to "one to many" expansions
- `fn visit_node`, corresponding to "one to one" expansions
All specific mut visitor methods now use one of these functions.
The new `InvocationCollectorNode` trait implemented for all `AstFragment` nodes provides the necessary small pieces of functionality required to implement the `(flat_map,visit)_node` functions.
r? `@Aaron1011`
|
|
Don't resolve blocks in foreign functions
Although it is an error for a foreign function to have a block, it is still possible at the level of the AST. #74204 made AST lowering skip over blocks belonging to foreign functions, since they're invalid. However, resolve still treated these blocks normally, resulting in a mismatch between the HIR and resolve, which could cause an ICE under certain circumstances. This PR changes resolve to skip over blocks belonging to foreign functions, as AST lowering does.
Fixes #91370.
r? ``@cjgillot``
|
|
Move crate drop-down to search results page
This reduces clutter on doc pages.
Part of #59840
r? ```@GuillaumeGomez```
Demo: https://rustdoc.crud.net/jsha/crates-in-results/std/index.html?search=str
|
|
Add release notes for 1.58
r? `@rust-lang/release`
|
|
rustc_metadata: Optimize and document module children decoding
The first commit limits the item in the `item_children`/`each_child_of_item` query to modules (in name resolution sense) and adds a corresponding assertion.
The `associated_item_def_ids` query collecting children of traits and impls specifically now uses a simplified implementation not decoding unnecessary data instead of `each_child_of_item`, this gives a nice performance improvement.
The second commit does some renaming that clarifies the terminology used for all items in a module vs `use` items only.
|
|
Remove LazyMeta::min_size
It is extremely conservative and as such barely reduces the size of encoded Lazy distances, but does increase complexity.
|
|
Also rename `module_exports`/`export_map` to `module_reexports`/`reexport_map` for clarity.
|
|
`module_children(_untracked)`
And `each_child_of_item` to `for_each_module_child`
|
|
|
|
Switch all libraries to the 2021 edition
The fix for https://github.com/rust-lang/rust/issues/88638#issuecomment-996620107 is to simply add const-stability for these functions.
r? `@m-ou-se`
Closes #88638.
|
|
|
|
Don't perform any new queries while reading a query result on disk
In addition to being very confusing, this can cause us to add dep node edges between two queries that would not otherwise have an edge.
We now panic if any new dep node edges are created during the deserialization of a query result. This requires serializing the full `AdtDef` to disk, instead of just serializing the `DefId` and invoking the `adt_def` query during deserialization.
I'll probably split this up into several smaller PRs for perf runs.
|
|
This adds `as_mut()` method for `*const T` and `as_const()` for `*mut T`
which are intended to make casting of consts safer. This was discussed
in the [internals discussion][discussion].
[discussion]: https://internals.rust-lang.org/t/casting-constness-can-be-risky-heres-a-simple-fix/15933
|
|
Add a query for resolving an impl item from the trait item
This makes finding the item in an impl that implements a given trait item a query. This is for a few reasons:
- To slightly improve performance
- To avoid having to do name resolution during monomorphisation
- To make it easier to implement potential future features that create anonymous associated items
|
|
|
|
Change from syntaxy-looking [src] to the plain word "source".
|
|
|
|
It is extremely conservative and as such barely reduces the size of
encoded Lazy distances, but does increase complexity.
|
|
Bump version to 1.60.0
Part of the release process, cc `@rust-lang/release`
r? `@ghost`
|
|
rustdoc: Remove apparently unnecessary conditional in `doc_value`
I need to remove this conditional for #91072, but while it seems
unnecessary, we are not certain. So, the plan is to first remove the
conditional and see if any regressions pop up before doing the refactor.
This way, it will be easier to revert if there are subtle regressions.
r? `@jyn514`
|
|
Rollup of 8 pull requests
Successful merges:
- #84640 (Implement `TryFrom<char>` for `u8`)
- #92336 (Remove &self from PrintState::to_string)
- #92375 (Consolidate checking for msvc when generating debuginfo)
- #92568 (Add note about non_exhaustive to variant_count)
- #92600 (Add some missing `#[must_use]` to some `f{32,64}` operations)
- #92610 (Create CSS class instead of using inline style for search results)
- #92632 (Implement stabilization of `#[feature(available_parallelism)]`)
- #92650 (Fix typo in `StableCrateId` docs)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Fix typo in `StableCrateId` docs
|
|
r=joshtriplett
Implement stabilization of `#[feature(available_parallelism)]`
Stabilized in https://github.com/rust-lang/rust/issues/74479#issuecomment-984379800. Closes https://github.com/rust-lang/rust/issues/74479. Thanks!
cc/ ``@rust-lang/libs-api``
|
|
r=jsha
Create CSS class instead of using inline style for search results
I saw this change in the update you proposed in https://github.com/rust-lang/rust/pull/92404. :)
r? ``@jsha``
|
|
Add some missing `#[must_use]` to some `f{32,64}` operations
This PR adds `#[must_use]` to the following methods:
- `f32::recip`
- `f32::max`
- `f32::min`
- `f32::maximum`
- `f32::minimum`
and their equivalents in `f64`.
These methods all produce a new value without modifying the original and so are pointless to call without using the result.
|
|
Add note about non_exhaustive to variant_count
Since `variant_count` isn't returning something opaque, I thought it makes sense to explicitly call out that its return value may change for some enums.
cc #73662
|
|
r=michaelwoerister
Consolidate checking for msvc when generating debuginfo
If the target we're generating code for is msvc, then we do two main
things differently: we generate type names in a C++ style instead of a
Rust style and we generate debuginfo for enums differently.
I've refactored the code so that there is one function
(`cpp_like_debuginfo`) which determines if we should use the C++ style
of naming types and other debuginfo generation or the regular Rust one.
r? ``@michaelwoerister``
This PR is not urgent so please don't let it interrupt your holidays! 🎄 🎁
|
|
Remove &self from PrintState::to_string
The point of `PrintState::to_string` is to create a `State` and evaluate the caller's closure on it:
https://github.com/rust-lang/rust/blob/e9fbe79292783972a222afd270db3f77c0b4f3c8/compiler/rustc_ast_pretty/src/pprust/state.rs#L868-L872
Making the caller *also* construct and pass in a `State`, which is then ignored, was confusing.
|
|
Implement `TryFrom<char>` for `u8`
Previously suggested in https://github.com/rust-lang/rfcs/issues/2854.
It makes sense to have this since `char` implements `From<u8>`. Likewise `u32`, `u64`, and `u128` (since #79502) implement `From<char>`.
|