Commit Graph

172327 Commits

Author SHA1 Message Date
Amanieu d'Antras
dfe68eede3 Add test for issue 99071 2022-07-11 14:47:22 +01:00
Rémy Rakic
9dd6f5246c extend bootstrap for PGO on windows
When building LLVM/LLD as part of a build that asks LLVM to generate profiles, e.g. when
doing PGO, cmake or clang-cl don't automatically link clang's profiler runtime in,
causing undefined reference errors at link-time.

We do that manually, by adding clang's resource library folder to the library search path:
- for LLVM itself, by extending the linker args that `rustc_llvm`'s build script
  uses, to avoid the linker errors when linking `rustc_driver`.
- for LLD, by extending cmake's linker flags during the LLD build step.
2022-07-11 15:43:28 +02:00
Rose Hudson
d84f7394a4 use PlaceRef::iter_projections to fix old FIXME
I added this function in 53481a5a8f
2022-07-11 14:42:49 +01:00
Amanieu d'Antras
e51f1b7e27 Keep unstable target features for asm feature checking
Inline assembly uses the target features to determine which registers
are available on the current target. However it needs to be able to
access unstable target features for this.

Fixes #99071
2022-07-11 14:26:58 +01:00
Rémy Rakic
94f8ee1f7c bump CI LLVM to 14.0.5
The version 14.0.2 we currently use is busted on windows at the very
least.
2022-07-11 15:20:46 +02:00
Guillaume Gomez
20b5c739d1 Continue themes CSS migration over CSS variables 2022-07-11 15:01:09 +02:00
Guillaume Gomez
01b4b60eae Remove unused CSS rules 2022-07-11 15:01:09 +02:00
bors
9fb32dc924 Auto merge of #99151 - Dylan-DPC:rollup-40aqkxy, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #98882 (explain doc comments in macros a bit)
 - #98907 (Deny float const params even when `adt_const_params` is enabled)
 - #99091 (Do not mention private types from other crates as impl candidates)
 - #99140 (Implement `SourceMap::is_span_accessible`)
 - #99147 (Mention similarly named associated type even if it's not clearly in supertrait)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-07-11 12:16:20 +00:00
Oli Scherer
8440208eb1 tidy 2022-07-11 11:07:03 +00:00
Oli Scherer
fcd7207d0e Make tests work on 32 bit and 64 bit 2022-07-11 10:43:47 +00:00
Oli Scherer
9a204509d2 Show sizes in error output 2022-07-11 10:34:01 +00:00
Oli Scherer
fef596f6a2 Rename assertion macro 2022-07-11 10:31:21 +00:00
Oli Scherer
af8536e32f Simplify assertion macro 2022-07-11 10:30:50 +00:00
Oli Scherer
3f4cf59323 Move checks to compile-time 2022-07-11 10:29:02 +00:00
Oli Scherer
984db78d77 Hide niches in SIMD types, too 2022-07-11 10:25:41 +00:00
Oli Scherer
423915590b More obvious closure name 2022-07-11 10:11:28 +00:00
Dylan DPC
21d6b1fc0e
Rollup merge of #99147 - compiler-errors:issue-55673, r=lcnr
Mention similarly named associated type even if it's not clearly in supertrait

Due to query cycle avoidance, we sometimes restrict the candidates in `complain_about_assoc_type_not_found` too much so that we can't detect typo replacements from just supertraits.

This creates a more general note of the existence of a similarly named associated type from _all_ visible traits when possible.

Fixes #55673
2022-07-11 15:19:33 +05:30
Dylan DPC
9fc297a2ae
Rollup merge of #99140 - TaKO8Ki:implement-is-accessible-span, r=fee1-dead
Implement `SourceMap::is_span_accessible`

This patch adds `SourceMap::is_span_accessible` and replaces `span_to_snippet(span).is_ok()` and `span_to_snippet(span).is_err()` with it. This removes a `&str` to `String` conversion.
2022-07-11 15:19:32 +05:30
Dylan DPC
93f71d4e01
Rollup merge of #99091 - compiler-errors:private-types-should-stay-private, r=lcnr
Do not mention private types from other crates as impl candidates

Fixes #99080
2022-07-11 15:19:31 +05:30
Dylan DPC
92b8adf8e0
Rollup merge of #98907 - compiler-errors:plz-no-float, r=oli-obk
Deny float const params even when `adt_const_params` is enabled

Supersedes #98825
Fixes #98813

r? ``@oli-obk``
2022-07-11 15:19:30 +05:30
Dylan DPC
943152008f
Rollup merge of #98882 - compiler-errors:explain-doc-comments-in-macros, r=davidtwco
explain doc comments in macros a bit

Open to suggestions on improving this... macro parsing is very foreign to me.

Should we have a structured suggestion to turn them into their regular non-doc comments?

Fixes #92846
Fixes #97850
2022-07-11 15:19:29 +05:30
bors
7d1f57a757 Auto merge of #97841 - nvzqz:inline-encode-wide, r=thomcc
Inline Windows `OsStrExt::encode_wide`

User crates currently produce much more code than necessary because the optimizer fails to make assumptions about this method.
2022-07-11 09:30:54 +00:00
Guillaume Gomez
b65d3a6ef2 Add tests for -Chelp and -Zhelp 2022-07-11 11:27:35 +02:00
Guillaume Gomez
992346d7bd Fix rustdoc -Zhelp and -Chelp options 2022-07-11 10:58:05 +02:00
Pietro Albini
6bc97d0adc
configure nightly branch name in stage0.json 2022-07-11 10:15:13 +02:00
Pietro Albini
b6df2a70f0
remove the need to update bump-stage0 with new stage0 config fields 2022-07-11 10:13:35 +02:00
Takayuki Maeda
018155c3a2 rename a method 2022-07-11 16:51:19 +09:00
Milo
e3d84b2809 clippy argument support 2022-07-11 07:42:10 +00:00
SOFe
01a9ff0e85
Clarify that [iu]size bounds were only defined for the target arch 2022-07-11 15:08:38 +08:00
Michael Goulet
913023b6b4 Use Visibility::is_accessible_from to make suggestion more specific 2022-07-11 07:06:18 +00:00
Michael Goulet
f2d8af10c2 Do not mention private Self types from other crates 2022-07-11 06:57:48 +00:00
Michael Goulet
680fef4d04 Mention similarly named associated type even if it's not clearly in supertrait 2022-07-11 06:53:11 +00:00
bors
2682b88c52 Auto merge of #98369 - jyn514:configure.py, r=Mark-Simulacrum
Remove unsupported options in configure.py

I've seen people using `optimize = false` and `full-bootstrap = true` in the past, without knowing
that they're not recommended. Remove `optimize` and a few other options that are always a bad idea,
and document that full-bootstrap is only for testing reproducible builds.
2022-07-11 06:37:20 +00:00
Michael Goulet
88f2140d87 Do not suggest same trait over again 2022-07-11 05:23:08 +00:00
Michael Goulet
0c39762dd6 Use fake substs to check for Self: Sized predicates on method receivers 2022-07-11 05:21:02 +00:00
Joshua Nelson
033a025b10 Don't rerun the build script for the compiler each time on linux
In practice, this doesn't matter very much because the script takes ~no time to run.
But this makes `CARGO_LOG=info` easier to read, and theoretically saves a few milliseconds.
2022-07-10 23:57:25 -05:00
Michael Howell
6c44357e14 fix(doctest): treat fatal parse errors as incomplete attributes
Fixes #99089
2022-07-10 20:58:54 -07:00
bors
a51fb2ba82 Auto merge of #99130 - jyn514:std-cache-invalidation, r=Mark-Simulacrum
Fix `x build library/std compiler/rustc`

Previously, this was broken because of improper caching:
1. `StepDescription::maybe_run` builds `Compile::Std`, which only built `std` and not `proc_macro`
1. `Std` calls `builder.ensure(StdLink)`
1. `Rustc` calls `ensure(Std)`, which builds all crates, including `proc_macro`
1. `Rustc` calls `ensure(StdLink)`. `ensure` would see that it had already been run and do nothing.  <-- bug is here
1. Cargo gives an error that `proc_macro` doesn't exist.

This fixes the caching by adding `crates` to `StdLink`, so it will get rerun if the crates that are built change.

Fixes https://github.com/rust-lang/rust/issues/99129.
2022-07-11 03:56:37 +00:00
Joshua Nelson
939510348d Give a better error when x dist fails for an optional tool
Before:
```
thread 'main' panicked at 'Unable to build RLS', dist.rs:42:9
```

After:
```
thread 'main' panicked at 'Unable to build submodule tool RLS (use `missing-tools = true` to ignore this failure)
note: not all tools are available on all nightlies
help: see https://forge.rust-lang.org/infra/toolstate.html for more information', dist.rs:43:9
```
2022-07-10 21:53:06 -05:00
Takayuki Maeda
12d11e9a35 implement is_accessible_span 2022-07-11 11:36:15 +09:00
bors
adaddb5bab Auto merge of #98526 - jyn514:download-llvm-outside-checkout, r=Mark-Simulacrum
Allow using `download-ci-llvm = true` outside the git checkout

`@bjorn3` noticed that this is already allowed today when download-llvm is disabled, but breaks with it enabled:
```
$ ./rust2/x.py build
fatal: not a git repository (or any of the parent directories): .git
thread 'main' panicked at 'command did not execute successfully: "git" "rev-list" "--author=bors@rust-lang.org" "-n1" "--first-parent" "HEAD" "--" "/home/jnelson/rust-lang/rust2/src/llvm-project" "/home/jnelson/rust-lang/rust2/src/bootstrap/download-ci-llvm-stamp" "/home/jnelson/rust-lang/rust2/src/version"
expected success, got: exit status: 128', src/bootstrap/native.rs:134:20
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

Support it too for consistency. It's unclear to me when anyone would need to use this, but `@bjorn3`
feels we should support it, and it's not much additional effort to get it working.
2022-07-11 01:15:47 +00:00
Christopher Durham
079d3eb22f Take advantage of known-valid-align in layout.rs 2022-07-10 20:34:39 -04:00
Michael Goulet
a1634642e0 Deny floats even when adt_const_params is enabled 2022-07-11 00:04:00 +00:00
Michael Goulet
d2e5a929b9 use subdiagnostic for message 2022-07-10 23:43:46 +00:00
Michael Goulet
2a973e2abc explain doc comments in macros a bit 2022-07-10 23:42:50 +00:00
Joshua Nelson
7d4bd54f75 Fix x build library/std compiler/rustc
Previously, this was broken because of improper caching:
1. `StepDescription::maybe_run` builds `Compile::Std`, which only built `std` and not `proc_macro`
1. `Std` calls `builder.ensure(StdLink)`
1. `Rustc` calls `ensure(Std)`, which builds all crates, including `proc_macro`
1. `Rustc` calls `ensure(StdLink)`. `ensure` would see that it had already been run and do nothing.  <-- bug is here
1. Cargo gives an error that `proc_macro` doesn't exist.

This fixes the caching by adding `crates` to `StdLink`, so it will get rerun if the crates that are
built change.  This also does the same for `RustcLink`; it doesn't matter in practice currently
because nothing uses it except `impl Step for Rustc`, but it will avoid bugs if we start using it in
the future (e.g. to build individual crates for rustfmt).
2022-07-10 17:50:09 -05:00
bors
e1b348fe21 Auto merge of #99133 - matthiaskrgr:rollup-eignphd, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #98713 (promote placeholder bounds to 'static obligations)
 - #99094 (Remove extra space in AtomicPtr::new docs)
 - #99095 (Remove duplicate notes from error on inter-crate ambiguous impl of traits)
 - #99114 (Group .test-arrow CSS rules and fix rgb/rgba property)
 - #99128 (Fix `download-ci-llvm` NixOS patching for binaries)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-07-10 22:34:50 +00:00
est31
cb5e94bb62 Remove box syntax from doctest.rs
Doctests are fairly cold code, so even if there
is a regression, which i doubt, it won't matter.
2022-07-11 00:34:22 +02:00
est31
94a09232ff Remove box syntax from Box<function pointer> construction
The function pointer should be extremely small, close to pointer size.
2022-07-11 00:34:21 +02:00
Matthias Krüger
7cd617490d
Rollup merge of #99128 - oxalica:fix/ci-llvm-patchelf, r=jyn514
Fix `download-ci-llvm` NixOS patching for binaries

LLVM tools should also be patched, since they are used in some tests, specially,
- src/test/run-make-fulldeps/cross-lang-lto (llvm-ar)
- src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs (llvm-ar)
- src/test/run-make-fulldeps/issue-64153 (llvm-objdump)

To be more future proof, we should patch all binaries in `bin`, which is done in this PR.
2022-07-11 00:33:51 +02:00