| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Rollup of 6 pull requests
Successful merges:
- #59776 (Apply resource-suffix to search-index and source-files scripts as well)
- #59784 (Suggest importing macros from the crate root)
- #59812 (Exclude profiler-generated symbols from MSVC __imp_-symbol workaround.)
- #59874 (Clean up handling of `-Z pgo-gen` commandline option.)
- #59890 (Don't generate empty json variables)
- #59911 (Revert "compile crates under test w/ -Zemit-stack-sizes")
Failed merges:
r? @ghost
|
|
Clean up handling of `-Z pgo-gen` commandline option.
This PR adapts the `-Z pgo-gen` flag to how Clang and GCC handle the corresponding `-fprofile-generate` flag. In particular, the flag now optionally takes a directory to place the profiling data in and allows to omit the argument (instead of having to pass an empty string).
|
|
Exclude profiler-generated symbols from MSVC __imp_-symbol workaround.
LLVM's profiling instrumentation adds a few symbols that are used by the profiler runtime. Since these show up as globals in the LLVM IR, the compiler generates `dllimport`-related `__imp_` stubs for them. This can lead to linker errors because the instrumentation symbols have weak linkage or are in a comdat section, but the `__imp_` stubs aren't.
Instead of trying to replicate the linkage/comdat setup for the stubs, this PR just excludes the profiler-related symbols from stub-generation since they aren't supposed to be referenced via `__declspec(dllimport)` anywhere anyway.
r? @alexcrichton
EDIT: I considered making this more general, i.e. inferring from the symbol name if it is a Rust symbol or not. But then I figured out that that would yield false negatives for `#[no_mangle]` et al, so I went with a blacklist approach.
|
|
Suggest importing macros from the crate root
Fixes #59764.
r? @estebank
cc @varkor
|
|
In `-Zprint-type-size` output, sort enum variants by size.
It's useful to see the biggest variants first.
r? @pnkfelix
|
|
Make duplicate matcher bindings a hard error
r? @Centril
Closes #57742
|
|
Re-export NonZero signed variant in std
Closes #59834 .
|
|
Mark variables captured by reference as mutable correctly
Closes #59620
r? @pnkfelix
|
|
Stabilize the `alloc` crate.
This implements RFC 2480:
* https://github.com/rust-lang/rfcs/pull/2480
* https://github.com/rust-lang/rfcs/blob/master/text/2480-liballoc.md
Closes https://github.com/rust-lang/rust/issues/27783
|
|
Rollup of 8 pull requests
Successful merges:
- #59781 (Remove check_match from const_eval)
- #59820 (proc_macro: stop using LEB128 for RPC.)
- #59846 (clarify what the item is in "not a module" error)
- #59847 (Error when using `catch` after `try`)
- #59859 (Suggest removing `?` to resolve type errors.)
- #59862 (Tweak unstable diagnostic output)
- #59866 (Recover from missing semicolon based on the found token)
- #59892 (Impl RawFd conversion traits for WASI TcpListener, TcpStream and UdpSocket)
Failed merges:
r? @ghost
|
|
|
|
Recover from missing semicolon based on the found token
When encountering one of a few keywords when a semicolon was
expected, suggest the semicolon and recover:
```
error: expected one of `.`, `;`, `?`, or an operator, found `let`
--> $DIR/recover-missing-semi.rs:4:5
|
LL | let _: usize = ()
| - help: missing semicolon here
LL |
LL | let _ = 3;
| ^^^
error[E0308]: mismatched types
--> $DIR/recover-missing-semi.rs:2:20
|
LL | let _: usize = ()
| ^^ expected usize, found ()
|
= note: expected type `usize`
found type `()`
```
|
|
Tweak unstable diagnostic output
|
|
Suggest removing `?` to resolve type errors.
Fixes #59756.
|
|
Error when using `catch` after `try`
Part of https://github.com/rust-lang/rust/issues/31436
|
|
clarify what the item is in "not a module" error
The motivation here was that I was trying to import an associated constant when I thought it was an enum variant, and got confused by this error.
Ideally I would like to add a note saying that associated constants, types, and methods cannot be imported, but I'm not sure that the associated items for a `Def` can be checked at resolve time.
|
|
Remove check_match from const_eval
This fixes #59378.
It seems that the `check_match` may be unnecessary, so this removes it per instructions provided in the issue. I re-ran the tests for `librustc_mir` and everything seemed fine!
|
|
This implements RFC 2480:
* https://github.com/rust-lang/rfcs/pull/2480
* https://github.com/rust-lang/rfcs/blob/master/text/2480-liballoc.md
Closes https://github.com/rust-lang/rust/issues/27783
|
|
Final (one can only hope) futures_api adjustments
Based on https://github.com/rust-lang/rust/pull/59119 -- this change is only the latter two commits.
cc https://github.com/rust-lang/rust/issues/59725
r? @withoutboats
|
|
|
|
Rollup of 15 pull requests
Successful merges:
- #59680 (Document the -Z flag to the rustc book)
- #59711 (Add back the substring test)
- #59806 (compiletest: Improve no_prefer_dynamic docs)
- #59809 (Make trait_methods_not_found use a lock)
- #59811 (Kill dead code dominator code.)
- #59814 (Fix broken links on std::boxed doc page)
- #59821 (improve unknown enum variant errors)
- #59831 (Remove strange formatting in `Ordering` docs.)
- #59836 (std::ops::Div examples: correct nominator to numerator)
- #59857 (SGX target: fix cfg(test) build)
- #59876 (Update TRPL to use mdbook 0.2)
- #59880 (Remove note about transmute for float bitpatterns.)
- #59889 (Update diagnostics.rs)
- #59891 (Fix the link to sort_by_cached_key)
- #59894 (save-analysis: Pull associated type definition using `qpath_def`)
Failed merges:
r? @ghost
|
|
improve unknown enum variant errors
Fixes #56517.
|
|
Add back the substring test
Fixes #58331.
r? @QuietMisdreavus
|
|
Ensure that exact matches come first in rustdoc search
Fixes #59287.
cc @scottmcm
r? @QuietMisdreavus
|
|
|
|
It's useful to see the biggest variants first.
|
|
This commit changes the suggestion so that it is split into multiple
parts in an effort to reduce the impact the applied suggestion could
have on formatting.
|
|
This commit removes the assumption that the start of a use statement
will always be on one line with a single space - which was silly in the
first place.
|
|
This commit introduces more dirty span manipulation into the compiler
in order to handle the various edge cases in moving/renaming the macro
import so it is at the root of the import.
|
|
This commit extends the suggestion to handle imports that are aliased to
another name.
|
|
This commit suggests importing a macro from the root of a crate as the
intent may have been to import a macro from the definition location that
was annotated with `#[macro_export]`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rustdoc: don't process `Crate::external_traits` when collecting intra-doc links
Part of https://github.com/rust-lang/rust/issues/58745, closes https://github.com/rust-lang/rust/pull/58917
The `collect-intra-doc-links` pass keeps track of the modules it recurses through as it processes items. This is used to know what module to give the resolver when looking up links. When looking through the regular items of the crate, this works fine, but the `DocFolder` trait as written doesn't just process the main crate hierarchy - it also processes the trait items in the `external_traits` map. This is useful for other passes (so they can strip out `#[doc(hidden)]` items, for example), but here it creates a situation where we're processing items "outside" the regular module hierarchy. Since everything in `external_traits` is defined outside the current crate, we can't fall back to finding its module scope like we do with local items.
Skipping this collection saves us from emitting some spurious warnings. We don't even lose anything by skipping it, either - the docs loaded from here are only ever rendered through `html::render::document_short` which strips any links out, so the fact that the links haven't been loaded doesn't matter. Hopefully this removes most of the remaining spurious resolution warnings from intra-doc links.
r? @GuillaumeGomez
|
|
|
|
|
|
|
|
When encountering one of a few keywords when a semicolon was
expected, suggest the semicolon and recover:
```
error: expected one of `.`, `;`, `?`, or an operator, found `let`
--> $DIR/recover-missing-semi.rs:4:5
|
LL | let _: usize = ()
| - help: missing semicolon here
LL |
LL | let _ = 3;
| ^^^
error[E0308]: mismatched types
--> $DIR/recover-missing-semi.rs:2:20
|
LL | let _: usize = ()
| ^^ expected usize, found ()
|
= note: expected type `usize`
found type `()`
```
|
|
This commit adds a suggestion to remove the `?` from expressions if
removing the `?` would resolve a type error.
|
|
|
|
|
|
|
|
|
|
|
|
|