Commit Graph

213571 Commits

Author SHA1 Message Date
Joshua Nelson
0b3ffcbb0b Allow building std with cranelift
- Don't pass llvm-specific args when using cranelift
- Don't use `asm` in compiler_builtins when using cranelift
2022-12-22 11:50:19 -06:00
bors
cca80b9a81 Auto merge of #103957 - JakobDegen:drop-retag, r=RalfJung
Retag as FnEntry on `drop_in_place`

This commit changes the mir drop shim to always retag its argument as if it were a `&mut`.

cc rust-lang/unsafe-code-guidelines#373
2022-12-22 17:48:43 +00:00
Ralf Jung
9f241b3a26 abort immediately on bad mem::zeroed/uninit 2022-12-22 16:37:42 +01:00
bors
e5e4eef02d Auto merge of #106000 - nikic:lld-build, r=Mark-Simulacrum
Make LLD build forward-compatible with LLVM 16

Switch to using the cmake module instead of llvm-config. I believe this also removes the need for llvm-config-wrapper.
2022-12-22 13:59:15 +00:00
Nikita Popov
59b3157c45 Use LLVM_CMAKE_DIR for lld build
LLVM_CONFIG_PATH is no longer supported as of LLVM 16, switch to
using the cmake module instead.

We separately return the llvm-config and cmake directory paths,
because llvm-config always refers to the host binary, while
the cmake directory is for the target triple.
2022-12-22 12:48:57 +01:00
Yuki Okushi
34ae96868f
Add regression test for #94293
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-22 20:29:20 +09:00
bors
2d8651a927 Auto merge of #106034 - matthiaskrgr:rollup-2zpql33, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #104741 (Switch `#[track_caller]` back to a no-op unless feature gate is enabled)
 - #105769 (add function to tell the identical errors for ambiguity_errors)
 - #105843 (Suggest associated const on possible capitalization mistake)
 - #105966 (Re-enable `Fn` trait call notation error for non-tuple argument)
 - #106002 (codegen tests: adapt patterns to also work with v0 symbol mangling)
 - #106010 (Give opaque types a better coherence error)
 - #106016 (rustdoc: simplify link anchor to section expand JS)
 - #106024 (Fix ICE due to `todo!()` in `rustdoc` for `Term`s)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-12-22 11:06:51 +00:00
Guillaume Gomez
faebd7a788 Extend search GUI test to include search tab title color check 2022-12-22 11:38:59 +01:00
Guillaume Gomez
33ff610d13 Migrate search tab title color to CSS variable 2022-12-22 11:38:39 +01:00
Matthias Krüger
d2130e4274
Rollup merge of #106024 - JulianKnodt:add_term_html_docs, r=notriddle
Fix ICE due to `todo!()` in `rustdoc` for `Term`s

Left a todo awhile ago (I think), so fill it in to print a const for `Term`s.

Fixes #105952.

Should I add some annotations to the rustdoc test?
2022-12-22 11:03:53 +01:00
Matthias Krüger
793df7f5f0
Rollup merge of #106016 - notriddle:notriddle/link-has-onclick, r=GuillaumeGomez
rustdoc: simplify link anchor to section expand JS
2022-12-22 11:03:52 +01:00
Matthias Krüger
d4aca6bb24
Rollup merge of #106010 - oli-obk:tait_coherence_diagnostic, r=compiler-errors
Give opaque types a better coherence error
2022-12-22 11:03:52 +01:00
Matthias Krüger
eb07d98648
Rollup merge of #106002 - krasimirgg:v0sym, r=tmiasko
codegen tests: adapt patterns to also work with v0 symbol mangling

No functional changes intended.

These tests were failing under `new-symbol-mangling = true`, cf. https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/a.20few.20panic-abort.20tests.20fail.20under.20.60new-symbol-mangling.60.
This adapts the patterns to work in this case.
2022-12-22 11:03:51 +01:00
Matthias Krüger
6a215ab989
Rollup merge of #105966 - compiler-errors:issue-105936, r=eholk
Re-enable `Fn` trait call notation error for non-tuple argument

I have no idea why I delayed this bug... but also there doesn't seem to be a UI test that actually shows a change, so maybe that's why.

Fixes #105936
2022-12-22 11:03:51 +01:00
Matthias Krüger
ecdabb490c
Rollup merge of #105843 - compiler-errors:sugg-const, r=lcnr
Suggest associated const on possible capitalization mistake

Suggest `i32::MAX` if we typed `i32::max` without making a function call.

Fixes #93844
2022-12-22 11:03:50 +01:00
Matthias Krüger
2cace6aa5d
Rollup merge of #105769 - lyming2007:issue-105177-fix, r=eholk
add function to tell the identical errors for ambiguity_errors

if 2 errors of the kind and ident and span of the ident, b1, b2 and misc1 misc2 are the same we call these 2 ambiguity errors identical
prevent identical ambiguity error from pushing into vector of ambiguity_errors this will fix #105177
2022-12-22 11:03:50 +01:00
Matthias Krüger
0adf9e046b
Rollup merge of #104741 - bryangarza:bug-104588-async-track-caller, r=compiler-errors
Switch `#[track_caller]` back to a no-op unless feature gate is enabled

This patch fixes a regression, in which `#[track_caller]`, which was previously a no-op, was changed to actually turn on the behavior. This should instead only happen behind the `closure_track_caller` feature gate.

Also, add a warning for the user to understand how their code will compile depending on the feature gate being turned on or not.

Fixes #104588
2022-12-22 11:03:49 +01:00
bors
cce9e72c55 Auto merge of #104889 - GuillaumeGomez:fix-impl-block-in-const-expr, r=notriddle
Fix impl block in const expr

Fixes #83026.

The problem was that we didn't visit block expressions. Considering how big the [walk_expr](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_hir/intravisit.rs.html#678) function is, I decided to instead implement the `hir` visitor on the struct. It also answers the question which was in a comment for `RustdocVisitor`: we should have used a visitor instead of our ad-hoc implementation.

Adding this visitor also added some extra checks that weren't present before (check changes in `rustdoc-ui` tests).

r? `@notriddle`
2022-12-22 08:37:58 +00:00
yukang
3b38adf568 fix suggest span for #105494 2022-12-22 16:27:16 +08:00
yukang
459b234e6a fix #105494, Suggest remove last method call when type coerce with expected 2022-12-22 16:27:12 +08:00
Yuki Okushi
66ca5cca61
Move z-crate-attr test to the attributes dir
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-22 17:02:09 +09:00
Yuki Okushi
ba8d7cd3e1
Add regression test for #99647
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-22 17:02:09 +09:00
mochaaP
3e35b39d9d
std: only use LFS function on glibc
see #94173 and commit 27011b4185.
2022-12-22 16:01:27 +08:00
bors
75f4ee8b44 Auto merge of #106025 - matthiaskrgr:rollup-vz5rqah, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #105837 (Don't ICE in `check_must_not_suspend_ty` for mismatched tuple arity)
 - #105932 (Correct branch-protection ModFlagBehavior for Aarch64 on LLVM-15)
 - #105960 (Various cleanups)
 - #105985 (Method chain nitpicks)
 - #105996 (Test that async blocks are `UnwindSafe`)
 - #106012 (Clarify that raw retags are not permitted in Mir)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-12-22 05:30:00 +00:00
Ben Kimock
a2e09baa32 Fix phrasing 2022-12-21 23:21:40 -05:00
Michael Goulet
20052c83c0 Suggest associated const on capitalization error 2022-12-22 03:07:18 +00:00
bors
8574880108 Auto merge of #106023 - JohnTitor:rollup-k8mettz, r=JohnTitor
Rollup of 8 pull requests

Successful merges:

 - #105584 (add assert messages if chunks/windows are length 0)
 - #105602 (interpret: add read_machine_[ui]size convenience methods)
 - #105824 (str.lines() docstring: clarify that line endings are not returned)
 - #105980 (Refer to "Waker" rather than "RawWaker" in `drop` comment)
 - #105986 (Fix typo in reading_half_a_pointer.rs)
 - #105995 (Add regression test for #96530)
 - #106008 (Sort lint_groups in no_lint_suggestion)
 - #106014 (Add comment explaining what the scrape-examples-toggle.goml GUI test is about)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-12-22 02:16:59 +00:00
Ben Kimock
c2f459ca74 Clean up implementation, deduplicate in errors 2022-12-21 21:11:19 -05:00
Eric Holk
f20f86ec4e
Change comment to doc comment 2022-12-21 17:28:42 -08:00
kadmin
8a4cbf4f7b Fix ICE
Left a todo awhile ago (I think), so fill it in to print a const for `Term`s.
2022-12-22 01:24:43 +00:00
Michael Howell
2b661c33de rustdoc: simplify CSS and DOM for more-scraped-examples
This gets rid of the more-scraped-examples-inner wrapper, instead nesting the
children directly and using absolute positioning for the toggle line.
2022-12-21 18:03:31 -07:00
Jakob Degen
0229281d03 Don't run Drop terminators on types that do not have drop glue in const eval 2022-12-21 16:15:56 -08:00
Matthias Krüger
d0d0ccdca2
Rollup merge of #106012 - JakobDegen:retag-raw, r=RalfJung
Clarify that raw retags are not permitted in Mir

Not sure when this changed, but documentation and the validator needed to be updated. This also removes raw retags from custom mir.

cc rust-lang/miri#2735

r? `@RalfJung`
2022-12-22 01:01:15 +01:00
Matthias Krüger
f340e68907
Rollup merge of #105996 - Swatinem:async-is-unwindsafe, r=petrochenkov
Test that async blocks are `UnwindSafe`

This was a regression from the reverted #105250 which is now covered by a test.
2022-12-22 01:01:14 +01:00
Matthias Krüger
66544b57f4
Rollup merge of #105985 - compiler-errors:method-chain-nitpicks, r=estebank
Method chain nitpicks

Just fixing some little things I didn't see in review from that method chain PR.

r? `@estebank`
2022-12-22 01:01:14 +01:00
Matthias Krüger
ec7eb5b5ad
Rollup merge of #105960 - oli-obk:effect_cleanup, r=fee1-dead
Various cleanups

This PR pulls changes out of https://github.com/rust-lang/rust/pull/101900 that can land on master immediately

r? ``@fee1-dead``
2022-12-22 01:01:13 +01:00
Matthias Krüger
924a1d4a7a
Rollup merge of #105932 - MasterAwesome:aarch64-bti-llvm-15, r=nikic
Correct branch-protection ModFlagBehavior for Aarch64 on LLVM-15

When building with Fat LTO and BTI enabled on aarch64, the BTI is set to `Module::Min` for alloc shim but is set to `Module::Error` for the crate. This was fine when we were using LLVM-14 but LLVM-15 changes it's behaviour to support for compiling with different `mbranch-protection` flags.

Refer:
b0343a38a5

fixes https://github.com/rust-lang/rust/issues/102162
2022-12-22 01:01:13 +01:00
Matthias Krüger
3eccc297d4
Rollup merge of #105837 - compiler-errors:issue-105728, r=estebank
Don't ICE in `check_must_not_suspend_ty` for mismatched tuple arity

These expressions are just used for their spans, so make it best-effort here.

Fixes #105728
2022-12-22 01:01:12 +01:00
Yuki Okushi
4d50fa6989
Rollup merge of #106014 - GuillaumeGomez:add-gui-explanations-scrape-examples-toggle, r=notriddle
Add comment explaining what the scrape-examples-toggle.goml GUI test is about

r? `@notriddle`
2022-12-22 08:32:13 +09:00
Yuki Okushi
4c2dd75af3
Rollup merge of #106008 - uweigand:s390x-lintgroup-order, r=Nilstrieb
Sort lint_groups in no_lint_suggestion

The no_lint_suggestion routine passes a vector of lint group names to find_best_match_for_name.  That routine depends on the sort order of its input vector, which matters in case multiple inputs are at the same Levenshtein distance to the target name.

However, no_lint_suggestion currently just passes lint_groups.keys() as input vector - this is sorted in hash value order, which is not guaranteed to be stable, and in fact differs between big- and little-endian host platforms, causing test failures on s390x.

To fix this, always sort the lint groups before using their names as input to find_best_match_for_name.  In doing so, prefer non- deprecated lint group names over deprecated ones, and then use alphabetical order.

Fixes https://github.com/rust-lang/rust/issues/105379
2022-12-22 08:32:12 +09:00
Yuki Okushi
6c0dedb445
Rollup merge of #105995 - JohnTitor:issue-96530, r=compiler-errors
Add regression test for #96530

Closes #96530
r? `@compiler-errors`

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-22 08:32:12 +09:00
Yuki Okushi
5689a7b372
Rollup merge of #105986 - eltociear:patch-18, r=RalfJung
Fix typo in reading_half_a_pointer.rs

gurantee -> guarantee
2022-12-22 08:32:11 +09:00
Yuki Okushi
03a763c5c8
Rollup merge of #105980 - goffrie:waker-drop, r=thomcc
Refer to "Waker" rather than "RawWaker" in `drop` comment

In my view this is technically more correct as `Waker` actually implements `Drop` (which calls the `drop` method) whereas `RawWaker` does not.
2022-12-22 08:32:11 +09:00
Yuki Okushi
257edf2de5
Rollup merge of #105824 - zacchiro:patch-1, r=JohnTitor
str.lines() docstring: clarify that line endings are not returned

Previously, the str.lines() docstring stated that lines are split at line endings, but not whether those were returned or not.  This new version of the docstring states this explicitly, avoiding the need of getting to doctests to get an answer to this FAQ.
2022-12-22 08:32:10 +09:00
Yuki Okushi
4f29ca386f
Rollup merge of #105602 - RalfJung:read-convenience, r=oli-obk
interpret: add read_machine_[ui]size convenience methods

We have `read_pointer`, so it felt inconsistent to not also have these.

r? ```@oli-obk```
2022-12-22 08:32:10 +09:00
Yuki Okushi
342d1b7f01
Rollup merge of #105584 - raffimolero:patch-1, r=JohnTitor
add assert messages if chunks/windows are length 0
2022-12-22 08:32:09 +09:00
Bryan Garza
ccbba0a60e Update track_caller tests; run fmt 2022-12-21 23:25:08 +00:00
bors
bdbe392a13 Auto merge of #105613 - Nilstrieb:rename-assert_uninit_valid, r=RalfJung
Rename `assert_uninit_valid` intrinsic

It's not about "uninit" anymore but about "filling with 0x01 bytes" so the name should at least try to reflect that.

This is actually not fully correct though, as it does still panic for all uninit with `-Zstrict-init-checks`. I'm not sure what the best way is to deal with that not causing confusion. I guess we could just remove the flag? I don't think having it makes a lot of sense anymore with the direction that we have chose to go. It could be relevant again if #100423 lands so removing it may be a bit over eager.

r? `@RalfJung`
2022-12-21 23:20:04 +00:00
Jakob Degen
37e00165e4 Bless tests 2022-12-21 14:59:55 -08:00
Jakob Degen
c359ab0b5d Retag argument to drop_in_place unconditionally 2022-12-21 14:59:55 -08:00