Commit Graph

171782 Commits

Author SHA1 Message Date
Camille GILLOT
43bb31b954 Allow to create definitions inside the query system. 2022-07-06 22:50:55 +02:00
bors
3dcb616888 Auto merge of #98959 - cjgillot:late-bound-order, r=michaelwoerister
Return a FxIndexSet in is_late_bound query.

This return value is iterated upon by borrowck, hence the need to preserve
a deterministic iteration order.

Fixes https://github.com/rust-lang/rust/issues/98890
Affects https://github.com/rust-lang/rust/issues/96655

I don't know if this supersedes https://github.com/rust-lang/rust/pull/98924 or fixes an unrelated bug.

r? `@michaelwoerister`
This may deserve a backport.
2022-07-06 17:38:48 +00:00
bors
049308cf8b Auto merge of #98970 - Dylan-DPC:rollup-j0od37w, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #98881 (Only compute DefKind through the query.)
 - #98884 (macros: `LintDiagnostic` derive)
 - #98964 (fix typo in function name)
 - #98967 (fix typo in note about multiple inaccessible type aliases)
 - #98968 (assert Scalar sanity)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-07-06 15:10:37 +00:00
bors
0aef72017f Auto merge of #98567 - Patryk27:update-llvm, r=nikic
Update llvm-project

Closes https://github.com/rust-lang/rust/issues/98167 🙂
2022-07-06 12:29:40 +00:00
Michael Woerister
8ff4115b5b
Add link to issue for src/test/incremental/async-lifetimes.rs 2022-07-06 11:32:55 +02:00
Dylan DPC
7f62a719af
Rollup merge of #98968 - RalfJung:scalar-sanity, r=oli-obk
assert Scalar sanity

With https://github.com/rust-lang/rust/pull/96814 having landed, finally our `Scalar` layouts have the invariants they deserve. :)
2022-07-06 14:49:13 +05:30
Dylan DPC
41e30e3371
Rollup merge of #98967 - ClementTsang:fix_inaccessible_type_alias_plural_typo, r=lcnr
fix typo in note about multiple inaccessible type aliases

Mainly intended as a small typo fix ("aliass" -> "aliases") for the case where a type cannot be found in scope but there are multiple inaccessible type aliases that match the missing type.

In general this change would use the correct plural form in this scenario for base words that end with 's'.
2022-07-06 14:49:12 +05:30
Dylan DPC
56667b5a07
Rollup merge of #98964 - RalfJung:typo, r=Dylan-DPC
fix typo in function name

I don't know what I was doing when I named that function...
follow-up to #98888
r? `@oli-obk`
2022-07-06 14:49:11 +05:30
Dylan DPC
df1f415305
Rollup merge of #98884 - davidtwco:translation-on-lints-derive, r=oli-obk
macros: `LintDiagnostic` derive

- Move `LintDiagnosticBuilder` into `rustc_errors` so that a diagnostic derive can refer to it.
- Introduce a `DecorateLint` trait, which is equivalent to `SessionDiagnostic` or `AddToDiagnostic` but for lints. Necessary without making more changes to the lint infrastructure as `DecorateLint` takes a `LintDiagnosticBuilder` and re-uses all of the existing logic for determining what type of diagnostic a lint should be emitted as (e.g. error/warning).
- Various refactorings of the diagnostic derive machinery (extracting `build_field_mapping` helper and moving `sess` field out of the `DiagnosticDeriveBuilder`).
- Introduce a `LintDiagnostic` derive macro that works almost exactly like the `SessionDiagnostic` derive macro  except that it derives a `DecorateLint` implementation instead. A new derive is necessary for this because `SessionDiagnostic` is intended for when the generated code creates the diagnostic. `AddToDiagnostic` could have been used but it would have required more changes to the lint machinery.

~~At time of opening this pull request, ignore all of the commits from #98624, it's just the last few commits that are new.~~

r? `@oli-obk`
2022-07-06 14:49:10 +05:30
Dylan DPC
707c0d9a2d
Rollup merge of #98881 - cjgillot:q-def-kind, r=fee1-dead
Only compute DefKind through the query.
2022-07-06 14:49:08 +05:30
fee1-dead
31629860e8
Fix double space 2022-07-06 17:02:58 +08:00
Camille GILLOT
9715ea4562 Add regression test. 2022-07-06 10:56:35 +02:00
bors
5b8cf49c51 Auto merge of #98206 - eggyal:align-to-chalk-folding-api, r=jackh726
Split TypeVisitable from TypeFoldable

Impl of rust-lang/compiler-team#520 following MCP approval.

r? `@ghost`
2022-07-06 05:48:11 +00:00
Alan Egerton
4f0a64736b
Update TypeVisitor paths 2022-07-06 06:41:53 +01:00
Ralf Jung
2a1a718baa add test 2022-07-05 22:26:26 -04:00
Ralf Jung
8f867c5445 finally enable Scalar layout sanity checks 2022-07-05 22:26:26 -04:00
ClementTsang
503c669927 fix typo in note about multiple inaccessible type aliases
Mainly intended as a small typo fix ("aliass" -> "aliases") for
the case where a type cannot be found in scope, and there are
multiple inaccessible type aliases that match the missing type.

In general this change would use the correct plural form in
this scenario for words that end with 's'.
2022-07-05 21:21:12 -04:00
bors
f342bea9d1 Auto merge of #98963 - GuillaumeGomez:rollup-n030us5, r=GuillaumeGomez
Rollup of 6 pull requests

Successful merges:

 - #95503 (bootstrap: Allow building individual crates)
 - #96814 (Fix repr(align) enum handling)
 - #98256 (Fix whitespace handling after where clause)
 - #98880 (Proper macOS libLLVM symlink when cross compiling)
 - #98944 (Edit `rustc_mir_dataflow::framework::lattice::FlatSet` docs)
 - #98951 (Update books)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-07-05 23:12:34 +00:00
Ralf Jung
4687afa480 fix type in function name 2022-07-05 17:48:43 -04:00
Guillaume Gomez
0eded16705
Rollup merge of #98951 - ehuss:update-books, r=ehuss
Update books

## nomicon

2 commits in 3a43983b76174342b7dbd3e12ea2c49f762e52be..70db9e4189f64d1d8e2451b1046111fb356b6dc2
2022-05-30 17:01:30 +0900 to 2022-06-27 20:47:21 +0900
- should be `size_of` instead of `align_of` (rust-lang/nomicon#371)
- Fix wording on the aliasing section (rust-lang/nomicon#366)

## book

20 commits in efbafdba3618487fbc9305318fcab9775132ac15..cf2653a5ca553cbbb4a17f1a7db1947820f6a775
2022-06-19 21:06:50 -0400 to 2022-07-05 12:07:58 -0400
- Frontmatter
- Update to Rust 1.62
- Extract where clause example so it'll get rustfmtted in the future
- Merge remote-tracking branch 'origin/pr/3238' into extract-where-clause-example
- Fix line wrapping of lib placement fix
- Fix grammar, spelling, and line wrapping of description of appendices
- Merge remote-tracking branch 'origin/pr/3244' into binlib
- Clarify *type* parameter names
- Fix listing 8-21. Fixes rust-lang/book#3251
- Propagate tech review changes for ch13
- Responses to tech review of chapter 13
- Tech review comments on chapter 13
- Fix double the
- Propagate tech review chapter 1 changes to src
- Address tech review comments for chapter 1
- Tech review comments for chapter 1
- Fix grammar
- Fix grammar
- Edits to edits to the introduction
- Comments from nostarch on the introduction

## rust-by-example

8 commits in 1095df2a5850f2d345fad43a30633133365875ba..83724ca387a2a1cd3e8d848f62820020760e358b
2022-06-18 21:47:12 -0300 to 2022-07-05 10:38:07 -0300
- changing names of params (rust-lang/rust-by-example#1567)
- Update incorrect print output in std/box.md (rust-lang/rust-by-example#1564)
- minor typo (rust-lang/rust-by-example#1563)
- fix: Fibonacci sequence starts from zero (rust-lang/rust-by-example#1562)
- add Vietnamese version on README.md (rust-lang/rust-by-example#1561)
- Update variadics.md (rust-lang/rust-by-example#1559)
- Change fold to sum in fn hof.md (rust-lang/rust-by-example#1560)
- Small typo, fixed compileable -> compilable (rust-lang/rust-by-example#1556)

## rustc-dev-guide

8 commits in 048d925f0a955aac601c4160c0e7f05771bcf63b..eb83839e903a0a8f1406f7e941886273f189b26b
2022-06-21 22:25:34 +0900 to 2022-07-03 15:17:39 +0900
- Suggest a separate build directory for rust-analyzer (rust-lang/rustc-dev-guide#1378)
- Change the old filename, "src/stage0.txt" to "src/stage0.json" (rust-lang/rustc-dev-guide#1383)
- Add the config needed to get rust-analyzer working on src/bootstrap (rust-lang/rustc-dev-guide#1381)
- Fix path to hir_id_validator.rs
- leave formatOnSave to the user (rust-lang/rustc-dev-guide#1380)
- diagnostics: structs with new slug syntax (rust-lang/rustc-dev-guide#1377)
- Few readability fixes
- humorust: Forbid pineapple on pizza (rust-lang/rustc-dev-guide#1374)

## embedded-book

1 commits in e17dcef5e96346ee3d7fa56820ddc7e5c39636bc..766979590da8100998f0d662499d4a901d8d1640
2022-06-19 10:28:00 +0000 to 2022-07-04 09:13:58 +0000
- "linker `link.exe` not found" fix  (rust-embedded/book#321)
2022-07-05 23:43:34 +02:00
Guillaume Gomez
5d650bb92e
Rollup merge of #98944 - pierwill:flatset-docs, r=Dylan-DPC
Edit `rustc_mir_dataflow::framework::lattice::FlatSet` docs

Cosmetic improvements. Adds a paragraph break, and
ellipses to signify arbitrary size of a flat set.
2022-07-05 23:43:33 +02:00
Guillaume Gomez
3fe0191df8
Rollup merge of #98880 - topjohnwu:macos-dylib-cross, r=jyn514
Proper macOS libLLVM symlink when cross compiling

Follow up of #98418

When cross compiling on macOS with `llvm.link-shared` enabled, the symlink creation will fail after compiling LLVM for the target architecture, because it will attempt to create the symlink in the host LLVM directory, which was already created when being built.

This commit changes the symlink path to the actual LLVM output.

r? `@jyn514`
2022-07-05 23:43:32 +02:00
Guillaume Gomez
4986379d79
Rollup merge of #98256 - GuillaumeGomez:whitespace-where-clause, r=notriddle
Fix whitespace handling after where clause

Fixes #97733.

You can see the result [here](https://rustdoc.crud.net/imperio/whitespace-where-clause/doc/foo/index.html).

r? `@jsha`
2022-07-05 23:43:31 +02:00
Guillaume Gomez
3e802d72bb
Rollup merge of #96814 - RalfJung:enum-repr-align, r=oli-obk
Fix repr(align) enum handling

`enum`, for better or worse, supports `repr(align)`. That has already caused a bug in https://github.com/rust-lang/rust/issues/92464, which was "fixed" in https://github.com/rust-lang/rust/pull/92932, but it turns out that that fix is wrong and caused https://github.com/rust-lang/rust/issues/96185.

So this reverts #92932 (which fixes #96185), and attempts another strategy for fixing #92464: special-case enums when doing a cast, re-using the code to load the discriminant rather than assuming that the enum has scalar layout. This works fine for the interpreter.

However, #92464 contained another testcase that was previously not in the test suite -- and after adding it, it ICEs again. This is not surprising; codegen needs the same patch that I did in the interpreter. Probably this has to happen [around here](d32ce37a17/compiler/rustc_codegen_ssa/src/mir/rvalue.rs (L276)). Unfortunately I don't know how to do that -- the interpreter can load a discriminant from an operand, but codegen can only do that from a place. `@oli-obk` `@eddyb` `@bjorn3` any idea?
2022-07-05 23:43:30 +02:00
Guillaume Gomez
0a7f2c3a02
Rollup merge of #95503 - jyn514:build-single-crate, r=Mark-Simulacrum
bootstrap: Allow building individual crates

This aims to be as unintrusive as possible, but did still require adding a new `tail_args` field to all `Rustc` and `Std` steps.

New library and compiler crates are added to the sysroot as they are built, since it's useful to have e.g. just alloc and not std.

Fixes https://github.com/rust-lang/rust/issues/44293.
2022-07-05 23:43:28 +02:00
Alan Egerton
e9e5d0685b
Relax constrained generics to TypeVisitable 2022-07-05 22:25:43 +01:00
Alan Egerton
f66c06f7f2
Explicit TypeVisitable implementations 2022-07-05 22:25:35 +01:00
Alan Egerton
9ffdc2de8c
impl TypeVisitable in type traversal macros 2022-07-05 22:25:33 +01:00
Alan Egerton
e4b9625b87
Add #[derive(TypeVisitable)] 2022-07-05 22:25:15 +01:00
Camille GILLOT
974b1e3e51 Clarify the behaviour from inside the query system. 2022-07-05 22:52:21 +02:00
Guillaume Gomez
c8a5b671a0 Add test for invalid whitespace display after where clause 2022-07-05 22:37:42 +02:00
bors
7b46aa594c Auto merge of #98954 - ehuss:update-cargo, r=ehuss
Update cargo

9 commits in dbff32b27893b899ae2397f3d56d1be111041d56..c0bbd42ce5e83fe2a93e817c3f9b955492d3130a
2022-06-24 19:25:13 +0000 to 2022-07-03 13:41:11 +0000
- fix typo (rust-lang/cargo#10818)
- fix(add): Don't panic with `--offline` (rust-lang/cargo#10817)
- chore: Set permissions for GitHub actions (rust-lang/cargo#10816)
- Bump to 0.65.0, update changelog (rust-lang/cargo#10812)
- Fix zsh completions for add and locate-project (rust-lang/cargo#10810)
- Bump cargo-util version. (rust-lang/cargo#10804)
- Update os_info (rust-lang/cargo#10802)
- Fix deserialization of check-cfg in config.toml (rust-lang/cargo#10799)
- fix: bash complete `install --path` with dirs (rust-lang/cargo#10798)
2022-07-05 20:31:45 +00:00
Camille GILLOT
2a7abed87f Return a FxIndexSet in is_late_bound query.
This return value is iterated upon by borrowck, hence the need to preserve
a deterministic iteration order.
2022-07-05 21:54:40 +02:00
Guillaume Gomez
c748551f7f Fix invalid add of whitespace when there is where clause 2022-07-05 21:45:27 +02:00
Eric Huss
4caec093d7 Update cargo 2022-07-05 11:58:38 -07:00
Eric Huss
15747dc910 Update books 2022-07-05 11:44:56 -07:00
Alan Egerton
bca894909c
Split TypeVisitable from TypeFoldable 2022-07-05 19:18:19 +01:00
bors
41ad4d9b2d Auto merge of #98936 - matthiaskrgr:rollup-dvr0ucm, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #98860 (adjust dangling-int-ptr error message)
 - #98888 (interpret: fix CheckedBinOp behavior when overflow checking is disabled)
 - #98889 (Add regression test for #79467)
 - #98895 (bootstrap.py: Always use `.exe` for Windows)
 - #98920 (adapt issue-37945 codegen test to accept any order of ops)
 - #98921 (Refactor: remove a redundant mutable variable)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-07-05 17:46:53 +00:00
Ralf Jung
d5721ce3a0 add asserts 2022-07-05 13:26:52 -04:00
Ralf Jung
cedc428a5f fix the layout of repr(align) enums 2022-07-05 13:24:21 -04:00
pierwill
f8b16c5d87 Edit rustc_mir_dataflow::framework::lattice::FlatSet docs
Cosmetic improvements. Adds a paragraph break, and
ellipses to signify arbitrary size of a flat set.
2022-07-05 11:34:39 -05:00
Patryk Wychowaniec
d61e4a4df0
Update llvm-project 2022-07-05 17:57:29 +02:00
Matthias Krüger
720eb123af
Rollup merge of #98921 - TaKO8Ki:refactor-fulfillment-context-select, r=Dylan-DPC
Refactor: remove a redundant mutable variable
2022-07-05 17:08:15 +02:00
Matthias Krüger
1c248ea22f
Rollup merge of #98920 - krasimirgg:llvm-15-issue-37945, r=nikic
adapt issue-37945 codegen test to accept any order of ops

Adapt this test to accept `icmp` operands in any order as a follow-up to cbbf06b0cd (commitcomment-77670922).
2022-07-05 17:08:14 +02:00
Matthias Krüger
a82f4a574e
Rollup merge of #98895 - ChrisDenton:no-elves-allowed, r=jyn514
bootstrap.py: Always use `.exe` for Windows

This ensures that it will run the Windows executable if other files in the directory (such as Linux executables) have the same file name minus the extension. I've been tripped up by this a few times where both `bootstrap` and `bootstrap.exe` end up in the same directory.

This PR avoids ever having to see the following message:

`OSError: [WinError 193] %1 is not a valid Win32 application`
2022-07-05 17:08:13 +02:00
Matthias Krüger
70ade7d503
Rollup merge of #98889 - TaKO8Ki:add-regression-test-for-79467, r=Dylan-DPC
Add regression test for #79467

closes #79467
2022-07-05 17:08:12 +02:00
Matthias Krüger
cca43fe8e2
Rollup merge of #98888 - RalfJung:interpret-checked-bin, r=oli-obk
interpret: fix CheckedBinOp behavior when overflow checking is disabled

Adjusts the interpreter to https://github.com/rust-lang/rust/pull/98738.

r? `@oli-obk`
2022-07-05 17:08:11 +02:00
Matthias Krüger
69195c026e
Rollup merge of #98860 - RalfJung:dangling-int-ptr, r=davidtwco
adjust dangling-int-ptr error message

based on suggestions by `@saethlin` in https://github.com/rust-lang/miri/issues/2163

Fixes https://github.com/rust-lang/miri/issues/2163

I also did a bit of refactoring on this, so we have a helper method to create a `Pointer` with `None` provenance.
2022-07-05 17:08:10 +02:00
David Wood
9d864c8d56 macros: add diagnostic derive for lints
`SessionDiagnostic` isn't suitable for use on lints as whether or not it
creates an error or a warning is decided at compile-time by the macro,
whereas lints decide this at runtime based on the location of the lint
being reported (as it will depend on the user's `allow`/`deny`
attributes, etc). Re-using most of the machinery for
`SessionDiagnostic`, this macro introduces a `LintDiagnostic` derive
which implements a `DecorateLint` trait, taking a
`LintDiagnosticBuilder` and adding to the lint according to the
diagnostic struct.
2022-07-05 16:00:21 +01:00
David Wood
7f9d8480d6 macros: move sess out of builder
`sess` field of `SessionDiagnosticDeriveBuilder` is never actually used
in the builder's member functions, so it doesn't need to be a field.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-05 16:00:21 +01:00