| Age | Commit message (Collapse) | Author | Lines |
|
Do not ICE when checking types against foreign fn
Fix #60275.
|
|
Do not allow const generics to depend on type parameters
Fixes https://github.com/rust-lang/rust/issues/60264. In https://github.com/rust-lang/rust/pull/58191/files/b534cf992d0189032207f395c27ed092c89b40c7#diff-aeb0880081a991f34aef2ab889e1fb7a, it was suggested that there might be a better place for this error, but as this bug already affects stable, it's probably worth merging this now, and refactoring afterwards (I can open an issue for this).
|
|
Add feature-gate for f16c target feature
r? @alexcrichton
|
|
Derive Default instead of new in applicable lint
Closes #60181
As far as I can see, at least within the `src/librustc_lint` directory this is the only place this is applicable.
|
|
Implement Debug for Place using Place::iterate
r? @oli-obk
|
|
Introduce hir::ExprKind::Use and employ in for loop desugaring.
In the `for $pat in $expr $block` desugaring we end with a `{ let _result = $match_expr; _result }` construct which makes `for` loops into a terminating scope and affects drop order. The construct was introduced in year 2015 by @pnkfelix in https://github.com/rust-lang/rust/pull/21984.
This PR replaces the construct with `hir::ExprKind::Use(P<hir::Expr>)` which is equivalent semantically but should hopefully be less costly in terms of compile time performance (to be determined).
This is extracted out of https://github.com/rust-lang/rust/pull/59288/commits/91b0abdfb23f980d2e5d5c30bc65ed8e95b04788 from https://github.com/rust-lang/rust/pull/59288 for easier review and so that the perf implications wrt. `for`-loops can be measured.
r? @oli-obk
|
|
Chalkify: Add builtin Copy/Clone
r? @nikomatsakis
|
|
Add Pin::{into_inner,into_inner_unchecked}
These functions are useful for unsafe code that needs to temporarily pull smart pointers out of the `Pin`, e.g. [the change that inspired them](https://github.com/Nemo157/futures-rs/commit/b4361780faf764c7cb046ed75f863a6fcfd44800#diff-1a4e0ba4d1b539412ca576411ec6c7c2R258) is taking a `Pin<Box<dyn Future>>`, turning it into a `*mut dyn Future` via `Box::into_raw(unsafe { Pin::into_inner_unchecked(pin) })` then later dropping this via `drop(Pin::from(Box::from_raw(ptr)))`. This can be accomplished today via `{ let ptr = unsafe { Pin::get_unchecked_mut(pin.as_mut()) } as *mut dyn Future; mem::forget(pin); ptr }`, but this is far more complicated and loses out on the symmetry of using `Box::into_raw` and `Box::from_raw`.
I'll extend the documentation on what guarantees `into_inner_unchecked` needs to uphold once I get some feedback on whether this API is wanted or not.
r? @withoutboats
|
|
Fix index-page generation
Fixes #60096.
The minifier was minifying crates name in `searchIndex` key position, which was a bit problematic for multiple reasons.
r? @rust-lang/rustdoc
|
|
Set cfg(test) when rustdoc is running with --test option
Following a [discussion on twitter](https://twitter.com/burntsushi5/status/1117091914199785473), I proposed this change. What do you think about it?
r? @QuietMisdreavus
cc @BurntSushi
|
|
Prevent failure in case no space left on device in rustdoc
Fixes #59703.
r? @QuietMisdreavus
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Improved error message when type must be bound due to generator.
Fixes #58930.
Keen to get some feedback - is this as minimal as we can get it or is there an existing visitor I could repurpose?
|
|
|
|
|
|
gate
|
|
|
|
Implement saturating_abs() and saturating_neg() functions for signed integer types
Similar to wrapping_abs() / wrapping_neg() functions but saturating at the numeric bounds instead of wrapping around. Complements the existing set of functions with saturation mechanics.
cc #59983
|
|
|
|
|
|
|
|
|
|
|
|
It looks like the `OutputType::Metadata` kind in the compiler was
misclassified in #38571 long ago by accident as incompatible with
codegen units and a single output file. This means that if you emit both
a linkable artifact and metadata it silently turns off multiple codegen
units unintentionally!
This commit corrects the situation to ensure that if `--emit metadata`
is used it doesn't implicitly disable multiple codegen units. This will
ensure we don't accidentally regress compiler performance when striving
to implement pipelined compilation!
|
|
Error now mentions type var name and span is highlighted.
|
|
|
|
Similar to wrapping_abs() / wrapping_neg() functions but saturating at
the numeric bounds instead of wrapping around. Complements the existing
set of functions with saturation mechanics.
|
|
submodules: update clippy from 9897442f to 8c0e038f
Should fix clippy/rls toolstate breakage
Changes:
````
Rustup for https://github.com/rust-lang/rust/pull/59042
Update pulldown_cmark to 0.5
Only run AppVeyor on r+, try and the master branch
Remove approx_constant known problems
Suppress let_and_return if let has attributes
Add test for or_fun_call macro suggestion
UI test cleanup: Extract needless_range_loop tests
Change "if types change" to "if you later change the type"
````
r? @oli-obk
|
|
|
|
|
|
|
|
Changes:
````
Rustup for https://github.com/rust-lang/rust/pull/59042
Update pulldown_cmark to 0.5
Only run AppVeyor on r+, try and the master branch
Remove approx_constant known problems
Suppress let_and_return if let has attributes
Add test for or_fun_call macro suggestion
UI test cleanup: Extract needless_range_loop tests
Change "if types change" to "if you later change the type"
````
|
|
Here, ExprKind::Use(P<Expr>) tweaks the drop order to act the
same way as '{ let _tmp = expr; _tmp }' does.
|
|
Add guard for missing comma in macro call suggestion
Fix #60233. Follow up to #58796.
r? @oli-obk
|
|
Breaking update of stdsimd
This commit updates stdsimd and contains two breaking changes:
* https://github.com/rust-lang-nursery/stdsimd/pull/733
* https://github.com/rust-lang-nursery/stdsimd/pull/586
We already did a crater run of 586 but we should do another one here.
r? @alexcrichton
|
|
Rollup of 6 pull requests
Successful merges:
- #59560 (MIR generation cleanup)
- #59697 (tweak unresolved label suggestion)
- #60038 (Add codegen test for PGO instrumentation.)
- #60160 (Fix #58270, fix off-by-one error in error diagnostics.)
- #60185 (Reexport IntErrorKind in std)
- #60243 (Add regression test for #53249.)
Failed merges:
r? @ghost
|
|
Add regression test for #53249.
Fixes #53249.
r? @cramertj
|
|
Reexport IntErrorKind in std
Currently `IntErrorKind` can only be found in `core`. @Centril confirmed on Discord that this is unintentional (should I r? him in this situation?).
Should there be a test for this? As far as this *specific* situation goes, I don't think so, I'll risk it and say that there's no way this regresses. However, it might be a good idea to have some tool detect public items in `core` that are not reexported in `std`. Does this belong in tidy, or should that be a separate tool? Is there some rustc-specific *linter*? Unless that's entirely a dumb idea, this should probably get an issue.
Note: My local build hasn't finished yet, but it's well past the point where I would expect problems.
|
|
r=estebank
Fix #58270, fix off-by-one error in error diagnostics.
This fixes #58270 by checking if two diagnostics overlap completely when we're calculating the line offset for each message.
|
|
Add codegen test for PGO instrumentation.
This PR adds a codegen test that makes sure that LLVM actually generates instrumentation code when we enable PGO instrumentation in `rustc`.
The second commit updates a test case to the new commandline option syntax introduced in #59874. Without the fix the test still works, but it confusingly creates a directory called `test.profraw`, which usually is the name of the _file_ where profiling data is collected.
|
|
tweak unresolved label suggestion
Only suggest label names in the same hygiene context, and use a
structured suggestion.
Question for reviewer: Is this the right way to check for label hygiene?
|
|
HirIdification: rework Map
The next iteration of HirIdification (#57578).
- remove `NodeId` from `Entry`
- change `Map::map` to an `FxHashMap<HirId, Entry>`
- base the `NodeId` `Map` methods on `HirId` ones (reverses the current state)
- HirIdify `librustdoc` a little bit (some `NodeId` `Map` methods were converted to work on `HirId`s)
The second change might have performance implications, so I'd do a perf run to be sure it's fine; it simplifies the codebase and shouldn't have an impact as long as the `Map` searches are cached (which is now possible thanks to using `HirId`s).
r? @Zoxc
|
|
|
|
|