Commit Graph

140302 Commits

Author SHA1 Message Date
Matthias Krüger
e006ee9be8
Rollup merge of #108722 - petrhosek:fuchsia-riscv, r=petrochenkov
Support for Fuchsia RISC-V target

Fuchsia is in the process of implementing the RISC-V support. This change implements the minimal Rust compiler support. The support for building runtime libraries will be implemented in follow up changes once Fuchsia SDK has the RISC-V support.
2023-03-14 17:40:03 +01:00
bors
669e751639 Auto merge of #104833 - Swatinem:async-identity-future, r=compiler-errors
Remove `identity_future` indirection

This was previously needed because the indirection used to hide some unexplained lifetime errors, which it turned out were related to the `min_choice` algorithm.

Removing the indirection also solves a couple of cycle errors, large moves and makes async blocks support the `#[track_caller]`annotation.

Fixes https://github.com/rust-lang/rust/issues/104826.
2023-03-14 10:12:58 +00:00
bors
c54af457d0 Auto merge of #109097 - matthiaskrgr:rollup-6ydc4ri, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #108419 (Stabilize `atomic_as_ptr`)
 - #108507 (use `as_ptr` to determine the address of atomics)
 - #108607 (Don't use fd-lock on Solaris in bootstrap)
 - #108830 (Treat projections with infer as placeholder during fast reject in new solver)
 - #109055 (create `config::tests::detect_src_and_out` test for bootstrap)
 - #109058 (Document BinOp::is_checkable)
 - #109081 (simd-wide-sum test: adapt for LLVM 17 codegen change)
 - #109083 (Update books)
 - #109088 (Gracefully handle `#[target_feature]` on statics)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-14 00:30:46 +00:00
Matthias Krüger
f6f238fbc0
Rollup merge of #109083 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/nomicon

1 commits in 79b53665a7c61d171fb8c5ad0b73b371f9ee6ba7..1f3e4cd4fd88b5b5d45feb86a11b6d2f93e5a974
2023-03-12 21:51:29 UTC to 2023-03-12 21:51:29 UTC

- Change incorrect reference to "above" in ffi.md (rust-lang/nomicon#404)

## rust-lang/reference

4 commits in a9afb04b47a84a6753e4dc657348c324c876102c..24c87f6663aed55b05d2cc286878f28f21918825
2023-03-11 13:53:24 UTC to 2023-02-28 16:07:20 UTC

- Document movbe target feature (rust-lang/reference#1336)
- fix typo (rust-lang/reference#1339)
- fix: Typo/reference (rust-lang/reference#1338)
- Document `cmpxchg16b` target feature (rust-lang/reference#1331)

## rust-lang/rustc-dev-guide

13 commits in b06dab84083390e0ee1e998f466545a8a1a76a9f..b1b6d693cd1461e53de4132c1b183ace31cd36e5
2023-03-13 02:42:00 UTC to 2023-03-03 11:12:51 UTC

- Rename `config.toml.example` to `config.example.toml` (rust-lang/rustc-dev-guide#1641)
- fix typo `SubstRef` to `SubstsRef` (rust-lang/rustc-dev-guide#1642)
- tracing log along diff crates (rust-lang/rustc-dev-guide#1640)
- Fix Rust Analyzer settings location (rust-lang/rustc-dev-guide#1637)
- Reflect the changes in rust-lang/rust#67000 (rust-lang/rustc-dev-guide#1632)
- improve capacity note (rust-lang/rustc-dev-guide#1634)
- Remove mention to lexer/parser refactoring (rust-lang/rustc-dev-guide#1629)
- Update date reference about infer context variables (rust-lang/rustc-dev-guide#1630)
- Update explnation about `Body.basic_blocks` (rust-lang/rustc-dev-guide#1631)
- Add detail to contributing guide (rust-lang/rustc-dev-guide#1628)
- Making the sentence more clear (rust-lang/rustc-dev-guide#1624)
- Fixed typing error (rust-lang/rustc-dev-guide#1623)
- update error code docs to reflect recent changes (rust-lang/rustc-dev-guide#1625)
2023-03-13 21:55:38 +01:00
Matthias Krüger
f33292fa5d
Rollup merge of #109055 - ozkanonur:detect_src_and_out, r=albertlarsan68
create `config::tests::detect_src_and_out` test for bootstrap

Resolves one of the `FIXME` in bootstrap
2023-03-13 21:55:37 +01:00
Matthias Krüger
6cec8cb5c2
Rollup merge of #108830 - compiler-errors:new-solver-fast-reject-faster, r=lcnr
Treat projections with infer as placeholder during fast reject in new solver

r? ``@lcnr``

Kind of a shame that we need to change all of the call sites for `for_each_relevant_impl`, etc. to pass an extra parameter. I guess I could have the "default" fn which calls a configurable fn?
2023-03-13 21:55:36 +01:00
Matthias Krüger
b4c7fc4ea1
Rollup merge of #108607 - psumbera:solaris-no-flock-bootstrap, r=albertlarsan68
Don't use fd-lock on Solaris in bootstrap

...as Solaris is missing flock()

fixes #103630
2023-03-13 21:55:36 +01:00
Nilstrieb
58884a30a0 Revert "enable ThinLTO for rustc on x86_64-pc-windows-msvc dist builds"
This lead to a miscompilation in at least `char::is_whitespace` and
probably in more unknown places.....

This reverts commit 684663ed38.
2023-03-13 21:18:54 +01:00
rustbot
f044156487 Update books 2023-03-13 13:00:51 -04:00
bors
8efa635b40 Auto merge of #109069 - lnicola:rust-analyzer-2023-03-13, r=lnicola
⬆️ `rust-analyzer`

r? `@ghost`
2023-03-13 16:54:43 +00:00
Petr Sumbera
04dfedb3e9 Don't use fd-lock on Solaris in bootstrap
...as Solaris is missing flock()

fixes #103630
2023-03-13 17:43:04 +01:00
Michael Goulet
84d254ead0 Better names? 2023-03-13 16:34:16 +00:00
Michael Goulet
c32527fb92 Treat projections with infer as placeholder during fast reject in new solver 2023-03-13 16:34:16 +00:00
bors
f1b1ed7e18 Auto merge of #108471 - clubby789:unbox-the-syntax, r=Nilstrieb,est31
Remove `box_syntax`

r? `@Nilstrieb`

This removes the feature `box_syntax`, which allows the use of `box <expr>` to create a Box, and finalises removing use of the feature from the compiler. `box_patterns` (allowing the use of `box <pat>` in a pattern) is unaffected.
It also removes `ast::ExprKind::Box` - the only way to create a 'box' expression now is with the rustc-internal `#[rustc_box]` attribute.
As a temporary measure to help users move away, `box <expr>` now parses the inner expression, and emits a `MachineApplicable` lint to replace it with `Box::new`

Closes #49733
2023-03-13 10:41:50 +00:00
Laurențiu Nicola
e8629011ae ⬆️ rust-analyzer 2023-03-13 10:42:24 +02:00
bors
d610b0c514 Auto merge of #109011 - jsha:reduce-allocations-inner-full-print, r=notriddle
rustdoc: reduce allocs in FnDecl::inner_full_print

Instead of maintaining parallel buffers for both HTML and non-HTML output, follow the idiom from the rest of format.rs that f.alternate() == true means textual output. Also, add an argument to control line wrapping explicitly.

This allows the caller to render once with textual output and no line wrapping, to decide whether line wrapping should be applied in the final HTML output.

Also, remove some format! and " ".repeat calls, and remove a dependency on calling `String::replace` to switch from newlines to spaces.

This coincidentally fixes some minor bugs where the old code was undercounting the number of characters for a declaration in text mode.
2023-03-13 02:17:49 +00:00
bors
b05bb29008 Auto merge of #108872 - cjgillot:simp-const-prop, r=oli-obk
Strengthen state tracking in const-prop

Some/many of the changes are replicated between both the const-prop lint and the const-prop optimization.

Behaviour changes:
- const-prop opt does not give a span to propagated values. This was useless as that span's primary purpose is to diagnose evaluation failure in codegen.
- we remove the `OnlyPropagateInto` mode. It was only used for function arguments, which are better modeled by a write before entry.
- the tracking of assignments and discriminants make clearer that we do nothing in `NoPropagation` mode or on indirect places.
2023-03-12 23:27:52 +00:00
ozkanonur
58c7b670ad create config::tests::detect_src_and_out test for bootstrap
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-03-12 22:18:56 +00:00
Matthias Krüger
5dc0113725
Rollup merge of #109052 - GuillaumeGomez:rustdoc-gui-tester-eslint, r=notriddle
Add eslint check for rustdoc-gui tester

r? `@notriddle`
2023-03-12 20:44:53 +01:00
Matthias Krüger
66f07c74d5
Rollup merge of #109031 - thomcc:config-example-toml, r=ozkanonur
Rename `config.toml.example` to `config.example.toml`

This had bothered me for a while as it leads to bad (missing) syntax highlighting in most editors I've used, and `@jyn514` suggested I just make the change and that the compatibility concerns I had don't really matter.

I suspect it will be a contentious one, so will not be offended if the outcome of this is to close the PR.
2023-03-12 20:44:51 +01:00
Matthias Krüger
afe257554c
Rollup merge of #109009 - notriddle:notriddle/edit-distance, r=GuillaumeGomez
rustdoc: use restricted Damerau-Levenshtein distance for search

Based on https://github.com/rust-lang/rust/pull/108200, for the same rationale.

> This replaces the existing Levenshtein algorithm with the Damerau-Levenshtein algorithm. This means that "ab" to "ba" is one change (a transposition) instead of two (a deletion and insertion). More specifically, this is a restricted implementation, in that "ca" to "abc" cannot be performed as "ca" → "ac" → "abc", as there is an insertion in the middle of a transposition. I believe that errors like that are sufficiently rare that it's not worth taking into account.

Before this change, searching [`prinltn!`] listed `print!` first, followed by `println!`. With this change, `println!` matches more closely.

[`prinltn!`]: https://doc.rust-lang.org/nightly/std/?search=prinltn!
2023-03-12 20:44:50 +01:00
Guillaume Gomez
cd9759ab92 Add rustdoc-gui eslint check into CI 2023-03-12 15:07:35 +01:00
Guillaume Gomez
77a8070852 Add eslint check for rustdoc-gui tester 2023-03-12 15:06:04 +01:00
clubby789
a8d5950b4d Remove box-syntax from unstable book 2023-03-12 13:19:46 +00:00
clubby789
0932452fa4 Remove box_syntax from AST and use in tools 2023-03-12 13:19:46 +00:00
clubby789
dd7df04e16 Remove uses of box_syntax in rustc and tools 2023-03-12 13:19:46 +00:00
Matthias Krüger
54c95a8072
Rollup merge of #109028 - GuillaumeGomez:rustdoc-js-tester-eslint, r=notriddle
Add eslint checks for rustdoc-js tester

r? ``@notriddle``
2023-03-12 08:13:29 +01:00
Matthias Krüger
0b0f334764
Rollup merge of #108984 - Teapot4195:issue-106803-fix, r=ozkanonur
bootstrap: document tidy

Enable documentation of tidy, as suggested in #106803. Jyn mentioned they should probably be added to `doc.rust-lang.org`, how should that be done?
2023-03-12 08:13:27 +01:00
Michael Howell
ce795d9ca8 rustdoc: collapse edit distance state into an object 2023-03-11 20:39:15 -07:00
Jacob Hoffman-Andrews
121ae1d29c rustdoc: reduce allocs in FnDecl::inner_full_print
Instead of maintaining parallel buffers for both HTML and non-HTML output,
follow the idiom from the rest of format.rs that f.alternate() == true means
textual output. Also, add an argument to control line wrapping explicitly.

This allows the caller to render once with textual output and no line wrapping,
to decide whether line wrapping should be applied in the final HTML output.

Also, remove some format! and " ".repeat calls, and remove a dependency on
calling `String::replace` to switch from newlines to spaces.

This coincidentally fixes some minor bugs where the old code was undercounting
the number of characters for a declaration in text mode.
2023-03-11 15:36:50 -08:00
Thom Chiovoloni
fcb2a3665f
Rename config.toml.example to config.example.toml 2023-03-11 14:10:00 -08:00
Guillaume Gomez
ca9b6180f0 Add rustdoc-js eslint check into CI 2023-03-11 21:42:11 +01:00
Guillaume Gomez
904d9c5c54 Improve rustdoc-js tester code clarity a bit 2023-03-11 21:40:17 +01:00
Guillaume Gomez
856c9bb481 Add eslint checks for rustdoc-js tester 2023-03-11 21:37:59 +01:00
est31
b2aeb07137 Use trimmed instead of line for performance 2023-03-11 20:43:04 +01:00
est31
3a20d52694 Extend the tidy lint to ftl files 2023-03-11 20:43:04 +01:00
est31
7a686bf41d tidy: enforce comment blocks to have even number of backticks
Some comments may be formed like:

// This function takes a tuple `(Vec<String>,
// Box<[u8]>)` and transforms it into `Vec<u8>`.

where the "back-ticked" section wraps around.
Therefore, we can't make a single-line based
lint.

We also cannot make the lint paragraph based,
as it would otherwise complain about inline
code blocks:

/// ```
/// use super::Foo;
///
/// fn main() { Foo::new(); }
/// ```

For the future, one could introduce some checks
to treat code blocks specially, but such code
would make the check even more complicated.
2023-03-11 20:40:18 +01:00
est31
cde0b164d2 tidy: allow direct format args capture in macro 2023-03-11 20:40:18 +01:00
Matthias Krüger
8b67955104
Rollup merge of #108950 - cjgillot:inherit-less, r=compiler-errors
Directly construct Inherited in typeck.

Using `InheritedBuilder` + a closure does not seem necessary any more.

+ a few opportunistic simplifications to typeck entry point.
2023-03-11 12:55:44 +01:00
Matthias Krüger
5e52ada714
Rollup merge of #108927 - Ayush1325:pal-cleanup, r=workingjubilee
Move __thread_local_inner to sys

Move `__thread_local_inner` macro in `crate:🧵:local` to `crate::sys`. Initially, I was thinking about removing this macro completely, but I could not find a way to create the generic statics without macros, so in the end, I just moved to code around.

This probably will need a rebase once https://github.com/rust-lang/rust/pull/108917 is merged

r? ``@workingjubilee``
2023-03-11 12:55:43 +01:00
Matthias Krüger
25794194fa
Rollup merge of #108784 - clubby789:askama-sidebar, r=jsha,GuillaumeGomez
rustdoc: Migrate sidebar rendering to Askama

cc #108757

Renders the sidebar for documentation using an Askama template
2023-03-11 12:55:43 +01:00
Matthias Krüger
949c553100
Rollup merge of #108757 - clubby789:askama-move, r=notriddle,jsha,GuillaumeGomez
rustdoc: Migrate `document_item_info` to Askama

https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/rustdoc.20allocations.20are.20slow

Hoping to piece-by-piece migrate things to template. Had a few failed attempts at more complex parts of the code, so this is just a start.
2023-03-11 12:55:42 +01:00
Matthias Krüger
8596751f3b
Rollup merge of #107629 - pitaj:rustdoc-search-deprecated, r=jsha
rustdoc: sort deprecated items lower in search

closes #98759

### Screenshots

`i32::MAX` show sup above `std::i32::MAX` and `core::i32::MAX`
![image](https://user-images.githubusercontent.com/803701/216725619-40afb7b0-e984-4a2e-ab5b-a95b24736b0e.png)
If just searching for `min`, the deprecated results show up far below other things:
![image](https://user-images.githubusercontent.com/803701/216725672-e4325d37-9bfe-47eb-a1fe-0e57092aa811.png)
one page later
![image](https://user-images.githubusercontent.com/803701/216725932-cd1c4a42-d527-44fb-a4ab-5a6d243659cc.png)

~~And, as you can see, the "Deprecation planned" message shows up in the search results. The same is true for fully-deprecated items like `mem::uninitialized`:
![image](https://user-images.githubusercontent.com/803701/216726268-1657e77a-563f-45a0-85a7-3a0cf4d66d6f.png)~~

Edit: the deprecation message change was removed from this PR. Only the sorting is changed.
2023-03-11 12:55:41 +01:00
bors
e350fe4e60 Auto merge of #109001 - matthiaskrgr:rollup-a3agnwp, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #105798 (Relax ordering rules for `asm!` operands)
 - #105962 (Stabilize path_as_mut_os_str)
 - #106085 (use problem matchers for tidy CI)
 - #107711 (Stabilize movbe target feature)
 - #108017 (Add `--no-undefined-version` link flag and fix associated breakage)
 - #108891 (Remove an extraneous include)
 - #108902 (no more do while :<)
 - #108912 (Document tool lints)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-11 07:28:44 +00:00
Michael Howell
dfd9e5e3fa rustdoc: use restricted Damerau-Levenshtein distance for search
Based on https://github.com/rust-lang/rust/pull/108200, for the same
rationale.

> This replaces the existing Levenshtein algorithm with the
> Damerau-Levenshtein algorithm. This means that "ab" to "ba" is one change
> (a transposition) instead of two (a deletion and insertion). More
> specifically, this is a restricted implementation, in that "ca" to "abc"
> cannot be performed as "ca" → "ac" → "abc", as there is an insertion in the
> middle of a transposition. I believe that errors like that are sufficiently
> rare that it's not worth taking into account.

Before this change, searching `prinltn!` listed `print!` first, followed
by `println!`. With this change, `println!` matches more closely.
2023-03-10 19:47:08 -07:00
bors
6dfaa14366 Auto merge of #104527 - ferrocene:pa-more-licenses, r=pnkfelix
Add more license annotations

This PR updates the `.reuse/dep5` file to include more accurate licensing data for everything in the repository (*excluding* submodules and dependencies). Some decisions were made in this PR:

* The standard copyright attribution for files maintained by us is "The Rust Project Developers (see https://thanks.rust-lang.org)", to avoid having to maintain an in-tree `AUTHORS` file.
* For files that have specific licensing terms, we added the terms to the `.reuse/dep5` rather than adding SPDX comments in the files themselves.
* REUSE picks up any comment/text line with `Copyright` on it, so I had to sprinkle around `REUSE-IgnoreStart` and `REUSE-IgnoreEnd` comments.

The rendered `COPYRIGHT` file is available at https://gist.github.com/pietroalbini/efb81103f69596d39758114f3f6a8688.

r? `@pnkfelix`
2023-03-11 01:17:23 +00:00
clubby789
2f166d1a15 Render doc sidebar using Askama 2023-03-10 20:21:45 +00:00
clubby789
bb37b600b3 Migrate document_item_info to templates 2023-03-10 20:18:38 +00:00
Matthias Krüger
b5de0089e1
Rollup merge of #106085 - fee1-dead-contrib:tidy-ci-matchers, r=pietroalbini
use problem matchers for tidy CI
2023-03-10 21:15:44 +01:00
bors
ff4b772f80 Auto merge of #108974 - flip1995:clippyup, r=Manishearth
Update Clippy

r? `@Manishearth`

cc `@m-ou-se` This sync also includes https://github.com/rust-lang/rust-clippy/pull/10275
2023-03-10 20:08:26 +00:00