| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Grammar : Missing "is" in format specifier diagnostic
|
|
r=Nilstrieb
Test the borrowck behavior of if-let guards
Add some tests to make sure that if-let guards behave the same as if guards with respect to borrow-checking. Most of them are a naive adaptation, replacing an `if` guard with `if let Some(())`.
This includes regression tests for notable issues that arose for if guards (#24535, #27282, #29723, #31287) as suggested in https://github.com/rust-lang/rust/issues/51114#issuecomment-900470419.
cc `@pnkfelix` are there any other tests that you would want to see?
cc tracking issue #51114
|
|
Only include metadata for non-dynamic libraries in rustc-dev
The actual object code should be linked from librustc_driver.so, which is still included in rustc-dev. This saves on download time and disk usage.
Fixes https://github.com/rust-lang/rust/issues/103538
|
|
do not add noalias in return position
`noalias` as a return attribute in LLVM indicates that the returned pointer does not alias anything else that is reachable from the caller, *including things reachable before this function call*. This is clearly not the case with a function like `fn id(Box<T>) -> Box<T>`, so we cannot use this attribute.
Fixes https://github.com/rust-lang/unsafe-code-guidelines/issues/385 (including an actual miscompilation that `@comex` managed to produce).
|
|
Rollup of 8 pull requests
Successful merges:
- #95985 (Add PhantomData marker to Context to make Context !Send and !Sync)
- #104298 (Add notes and examples about non-intuitive `PathBuf::set_extension` behavior)
- #105558 (Reduce HIR debug output)
- #106315 (Cleanup `mingw-tidy` docker job)
- #106354 (Rustdoc-Json: Report discriminant on all kinds of enum variant.)
- #106366 (Fix rustdoc ICE on bad typedef with mismatching types)
- #106376 (Update books)
- #106383 (Document some of the AST nodes)
Failed merges:
- #106356 (clean: Remove `ctor_kind` from `VariantStruct`.)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
GuillaumeGomez:fix-rustdoc-ice-typedef-type-mismatch, r=notriddle
Fix rustdoc ICE on bad typedef with mismatching types
Fixes https://github.com/rust-lang/rust/issues/106226.
Fixes #105742.
Fixes #105737.
Fixes #105334.
Fixes #96287.
In this case, it's ok to replace the panic with `rustc_error::raise` because the compiler provided us with a `Error`.
r? `@notriddle`
|
|
Rustdoc-Json: Report discriminant on all kinds of enum variant.
Closes https://github.com/rust-lang/rust/issues/106299
Probably easier to review one commit at a time.
r? `@GuillaumeGomez`
|
|
Reduce HIR debug output
HIR debug output is currently very verbose, especially when used with the alternate (`#`) flag. This commit reduces the amount of noisy newlines by forcing a few small key types to stay on one line, which makes the output easier to read and scroll by.
```
$ rustc +after hello_world.rs -Zunpretty=hir-tree | wc -l
582
$ rustc +before hello_world.rs -Zunpretty=hir-tree | wc -l
932
```
|
|
|
|
This allows analyzing the output programatically; for example, finding
the item with the highest `total_estimate`.
I also took the liberty of adding `untracked` tests to `rustc_session` and documentation to the unstable book for `dump-mono-items`.
|
|
Reenable limited top-down MIR inlining
Reverts most of #105119 and uses an alternative strategy to prevent exponential blowup. Specifically, we allow doing top-down inlining up to depth at most five, and for at most one call site per nested body.
r? `@cjgillot`
|
|
HIR debug output is currently very verbose, especially when used with
the alternate (`#`) flag. This commit reduces the amount of noisy
newlines by forcing a few small key types to stay on one line, which
makes the output easier to read and scroll by.
```
$ rustc +after hello_world.rs -Zunpretty=hir-tree | wc -l
582
$ rustc +before hello_world.rs -Zunpretty=hir-tree | wc -l
932
```
|
|
Add codegen test for issue 103840
Closes #103840
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Encode spans relative to the enclosing item -- enable on nightly
Follow-up to #84373 with the flag `-Zincremental-relative-spans` set by default.
This PR seeks to remove one of the main shortcomings of incremental: the handling of spans.
Changing the contents of a function may require redoing part of the compilation process for another function in another file because of span information is changed.
Within one file: all the spans in HIR change, so typechecking had to be re-done.
Between files: spans of associated types/consts/functions change, so type-based resolution needs to be re-done (hygiene information is stored in the span).
The flag `-Zincremental-relative-spans` encodes local spans relative to the span of an item, stored inside the `source_span` query.
Trap: stashed diagnostics are referenced by the "raw" span, so stealing them requires to remove the span's parent.
In order to avoid too much traffic in the span interner, span encoding uses the `ctxt_or_tag` field to encode:
- the parent when the `SyntaxContext` is 0;
- the `SyntaxContext` when the parent is `None`.
Even with this, the PR creates a lot of traffic to the Span interner, when a Span has both a LocalDefId parent and a non-root SyntaxContext. They appear in lowering, when we add a parent to all spans, including those which come from macros, and during inlining when we mark inlined spans.
The last commit changes how queries of `LocalDefId` manage their cache. I can put this in a separate PR if required.
Possible future directions:
- validate that all spans are marked in HIR validation;
- mark macro-expanded spans relative to the def-site and not the use-site.
|
|
Also update tests
|
|
|
|
rustdoc: use the regular arrow indicator for dir-entry CSS
This mostly reverts 468acca108e65101b802821bded17149dc1d86c9, while still fixing the problem it fixed by using an internal list-style-position. It results in a slight change in the hover indicator, but nothing misleading.
Preview: http://notriddle.com/notriddle-rustdoc-demos/dir-entry/src/std/lib.rs.html
## Before

## After

|
|
Merge multiple mutable borrows of immutable binding errors
Fix #53466.
|
|
|
|
|
|
|
|
|
|
|
|
Use the correct tracking issue for `dyn_star`
`#![feature(dyn_star)]` now has its own tracking issue, #102425.
|
|
Closes #106299
|
|
|
|
Add comment explaining what docblock-table GUI test is about
r? `@notriddle`
|
|
Fix #53466.
|
|
|
|
|
|
Rollup of 4 pull requests
Successful merges:
- #106280 (docs: add link to `Path::join` in `PathBuf::push`)
- #106297 (rustdoc: merge scrape-help CSS)
- #106328 (Add comment explaining what the GUI scrape-examples-fonts test is about)
- #106334 (Fix tidy unittest.)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Add comment explaining what the GUI scrape-examples-fonts test is about
r? `@notriddle`
|
|
refactor: merge error code `E0465` into `E0464`
`E0465` is an undocumented and untested error code that is functionally identical to `E0464`. This PR merges `E0465` into `E0464`, thus documenting and testing another error code (#61137).
r? `@GuillaumeGomez` (not sure if you want to review this but it's relevant to my other PRs that you have reviewed)
|
|
|
|
|
|
Suppress errors due to TypeError not coercing with inference variables
Fixes #75331
Fixes #68507
Fixes #82323
cc `@estebank`
|
|
|
|
Use verbose suggestions for mutability errors
|
|
|
|
GuillaumeGomez:extend-scraped-examples-layout-test, r=notriddle
Extend scraped examples layout GUI test for position of buttons
This is a regression test for https://github.com/rust-lang/rust/pull/106279.
r? ````@notriddle````
|
|
Revert "Implement allow-by-default `multiple_supertrait_upcastable` lint"
This is a clean revert of #105484.
I confirmed that reverting that PR fixes the regression reported in #106247. ~~I can't say I understand what this code is doing, but maybe it can be re-landed with a different implementation.~~ **Edit:** https://github.com/rust-lang/rust/issues/106247#issuecomment-1367174384 has an explanation of why #105484 ends up surfacing spurious `where_clause_object_safety` errors. The implementation of `where_clause_object_safety` assumes we only check whether a trait is object safe when somebody actually uses that trait with `dyn`. However the implementation of `multiple_supertrait_upcastable` added in the problematic PR involves checking *every* trait for whether it is object-safe.
FYI `@nbdd0121` `@compiler-errors`
|
|
CFI: Monomorphize transparent ADTs before typeid
Monomorphise `#[repr(transparent)]` parameterized ADTs before turning them into an Itanium mangled String.
`#[repr(transparent)]` ADTs currently use the single field to represent them in their CFI type ID to ensure that they are compatible. However, if that type involves a type parameter instantiated at the ADT level, as in `ManuallyDrop`, this will currently ICE as the `Parameter` type cannot be mangled. Since this happens at lowering time, it should always be concrete after substitution.
Fixes #106230
|
|
|