Replace tuple of infer vars for upvar_tys with single infer var
This commit allows us to decide the number of captures required after
completing capture ananysis, which is required as part of implementing
RFC-2229.
closes https://github.com/rust-lang/project-rfc-2229/issues/4
r? `@nikomatsakis`
Detect configuration for LLVM during setup
This is a first draft to address #77579, setting `download-ci-llvm` to true on Linux, but I could also implement the `if-available` setting mentioned in the issue.
On other platforms I was thinking about using [the which crate](https://crates.io/crates/which), if adding a dependency on it is considered okay of course, to detect the presence of `llvm-config` in the path, and use it if found. Still a work in progress of course.
Update books
## reference
5 commits in 56a13c082ee90736c08d6abdcd90462517b703d3..1b78182e71709169dc0f1c3acdc4541b6860e1c4
2020-09-14 23:20:16 -0700 to 2020-10-11 13:53:47 -0700
- Specify that SSE4.1 includes SSSE3 instead of SSE3 (rust-lang-nursery/reference#892)
- Fix mutable expressions that can be dereferenced (rust-lang-nursery/reference#890)
- Fix grammar in memory model (rust-lang-nursery/reference#889)
- Add style checks. (rust-lang-nursery/reference#886)
- Add description for LUB Coercion (rust-lang-nursery/reference#808)
## book
1 commits in cb28dee95e5e50b793e6ba9291c5d1568d3ad72e..451a1e30f2dd137aa04e142414eafb8d05f87f84
2020-09-09 10:06:00 -0500 to 2020-10-05 09:11:18 -0500
- clarify description of when ? can be used (rust-lang/book#2471)
## rust-by-example
1 commits in 7d3ff1c12db08a847a57a054be4a7951ce532d2d..152475937a8d8a1f508d8eeb57db79139bc803d9
2020-09-28 15:54:25 -0300 to 2020-10-09 09:29:50 -0300
- Add 1.45.0 cast documentation (rust-lang/rust-by-example#1384)
## embedded-book
2 commits in dd310616308e01f6cf227f46347b744aa56b77d9..79ab7776929c66db83203397958fa7037d5d9a30
2020-09-26 08:54:08 +0000 to 2020-10-12 08:00:05 +0000
- llvm-objdump: Use two hyphens in flags to objdump (rust-embedded/book#270)
- Start/hardware: clarify which file needs tweaking (rust-embedded/book#266)
Provide better documentation and help messages for x.py setup
Closes: #77861
I have split this up into tiny comments because I find it clearer this way. Feel free to squash it.
Remove unused code
Rustc has a builtin lint for detecting unused code inside a crate, but when an item is marked `pub`, the code, even if unused inside the entire workspace, is never marked as such. Therefore, I've built [warnalyzer](https://github.com/est31/warnalyzer) to detect unused items in a cross-crate setting.
Closes https://github.com/est31/warnalyzer/issues/2
We need a fresh input buffer each time, or we reuse the previous
data (since `read_line` appends).
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Put all()'s otuput in the order we want to print things in, and add a
comment about why they are in this order. Provide purpose() and
all_for_help(). Use these things everywhere.
Move all the abbrev character ("a", "b", etc.) processing into
interactive_path.
No functional change.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Rollup of 8 pull requests
Successful merges:
- #77765 (Add LLVM flags to limit DWARF version to 2 on BSD)
- #77788 (BTreeMap: fix gdb provider on BTreeMap with ZST keys or values)
- #77795 (Codegen backend interface refactor)
- #77808 (Moved the main `impl` for FnCtxt to its own file.)
- #77817 (Switch rustdoc from `clean::Stability` to `rustc_attr::Stability`)
- #77829 (bootstrap: only use compiler-builtins-c if they exist)
- #77870 (Use intra-doc links for links to module-level docs)
- #77897 (Move `Strip` into a separate rustdoc pass)
Failed merges:
- #77879 (Provide better documentation and help messages for x.py setup)
- #77902 (Include aarch64-pc-windows-msvc in the dist manifests)
r? `@ghost`
bootstrap: only use compiler-builtins-c if they exist
The assignment of `features` above was added in rust-lang#60981, but
never used. Presumably the intent was to replace the string literal here
with it.
While I'm in the area, `compiler_builtins_c_feature` doesn't need to be
a `String`.
I'm not entirely sure of a great way to locally test this -- `./x.py test`
passed on my machine, but 🤷♂️.
r? @alexcrichton
Switch rustdoc from `clean::Stability` to `rustc_attr::Stability`
This gives greater type safety and is less work to maintain on the rustdoc end. It also makes rustdoc more consistent with rustc.
Noticed this while working on https://github.com/rust-lang/rust/issues/76998.
- Remove `clean::Stability` in favor of `rustc_attr::Stability`
- Remove `impl Clean for Stability`; it's no longer necessary
r? @GuillaumeGomez
cc @petrochenkov
Moved the main `impl` for FnCtxt to its own file.
Resolves#77085 without breaking the API of the `FnCtxt` struct.
This is a solution to the file length being over 3000 (see issue #60302).
The other solution to the file length is
1. to change the API of this struct by
2. encapulating certain fields of the struct into other structs.
Codegen backend interface refactor
This moves several things away from the codegen backend to rustc_interface. There are a few behavioral changes where previously the incremental cache (incorrectly) wouldn't get finalized, but now it does. See the individual commit messages.
BTreeMap: fix gdb provider on BTreeMap with ZST keys or values
Avoid error when gdb is asked to inspect a BTreeMap or BTreeSet with a zero-sized type as key or value. And clean up.
r? @Mark-Simulacrum
Add LLVM flags to limit DWARF version to 2 on BSD
This has been a thorn in my side for a while, I can finally generate flamegraphs of rust programs on bsd again. This fixes dtrace profiling on freebsd, I think it might help with lldb as well but I can't test that because my current rust-lldb setup is messed up.
I'm limiting the dwarf version to 2 on all bsd's (netbsd/openbsd/freebsd) since it looks like this applies to all of them, but I have only tested on freebsd.
Let me know if there's anything I can improve!
---
Currently on FreeBSD dtrace profiling does not work and shows jumbled/incorrect
symbols in the backtraces. FreeBSD does not support the latest versions of DWARF
in dtrace (and lldb?) yet, and needs to be limited to DWARF2 in the same way as macos.
This adds an is_like_bsd flag since it was missing. NetBSD/OpenBSD/FreeBSD all
match this.
This effectively copies #11864 but targets FreeBSD instead of macos.
Refactor AST pretty-printing to allow skipping insertion of extra parens
Fixes#75734
Makes progress towards #43081
Unblocks PR #76130
When pretty-printing an AST node, we may insert additional parenthesis
to ensure that precedence is properly preserved in code we output.
However, the proc macro implementation relies on comparing a
pretty-printed AST node to the captured `TokenStream`. Inserting extra
parenthesis changes the structure of the reparsed `TokenStream`, making
the comparison fail.
This PR refactors the AST pretty-printing code to allow skipping the
insertion of additional parenthesis. Several freestanding methods are
moved to trait methods on `PrintState`, which keep track of an internal
`insert_extra_parens` flag. This flag is normally `true`, but we expose
a public method which allows pretty-printing a nonterminal with
`insert_extra_parens = false`.
To avoid changing the public interface of `rustc_ast_pretty`, the
freestanding `_to_string` methods are changed to delegate to a
newly-crated `State`. The main pretty-printing code is moved to a new
`state` module to ensure that it does not accidentally call any of these
public helper functions (instead, the internal functions with the same
name should be used).