Commit Graph

265598 Commits

Author SHA1 Message Date
Jubilee
8265506519
Rollup merge of #130244 - samueltardieu:qmark-expansion-span-fix, r=jieyouxu
Use the same span for attributes and Try expansion of ?

This is needed for Clippy to know that the `#[allow(unused)]` attributes added by the expansion of `?` are part of the desugaring, and that they do not come from the user code.

rust-lang/rust-clippy#13380 exhibits a manifestation of this problem and will be fixed by this change.
2024-09-11 15:53:24 -07:00
Jubilee
142598214c
Rollup merge of #130239 - RalfJung:miri-ptr-offset-unsigned, r=compiler-errors
miri: fix overflow detection for unsigned pointer offset

This is the Miri part of https://github.com/rust-lang/rust/pull/130229. This is already UB in codegen so we better make Miri detect it; updating the docs may take time if we have to follow some approval process, but let's make Miri match reality ASAP.

r? ``@scottmcm``
2024-09-11 15:53:24 -07:00
Jubilee
1e3d1ad4bc
Rollup merge of #130228 - RalfJung:intrinsics-notify, r=saethlin
notify Miri when intrinsics are changed

`@rust-lang/miri` should we notify the entire team, or should I just add myself?
2024-09-11 15:53:23 -07:00
Jubilee
eb9a4f7ab8
Rollup merge of #130168 - juliusl:pr/fix-win-fs-change-time-links, r=ChrisDenton
maint: update docs for change_time ext and doc links

maint: update docs for change_time ext and doc links

Related: https://github.com/rust-lang/rust/issues/121478
r? tgross35
2024-09-11 15:53:23 -07:00
Jubilee
a31a8fe0cf
Rollup merge of #130114 - eduardosm:needless-returns, r=compiler-errors
Remove needless returns detected by clippy in the compiler
2024-09-11 15:53:22 -07:00
Jubilee
c4488c49de
Rollup merge of #130077 - madsmtm:watchos-arm-unwind, r=workingjubilee
Fix linking error when compiling for 32-bit watchOS

In https://github.com/rust-lang/rust/pull/124494 (or https://github.com/rust-lang/rust/pull/124748), I mistakenly conflated "not SjLj" to mean "ARM EHABI", which isn't true, 32-bit watchOS uses a third unwinding method called "DWARF CFI".

So this PR is effectively a revert of https://github.com/rust-lang/rust/pull/124494, with a few more comments explaining what's going on.

Fixes https://github.com/rust-lang/rust/issues/130071.

r? Mark-Simulacrum (since you reviewed the original)
2024-09-11 15:53:22 -07:00
Jubilee
312b597a7e
Rollup merge of #129835 - RalfJung:float-tests, r=workingjubilee
enable const-float-classify test, and test_next_up/down on 32bit x86

The  test_next_up/down tests have been disabled on all 32bit x86 targets, which goes too far -- they should definitely work on our (tier 1) i686 target, it is only without SSE that we might run into trouble due to https://github.com/rust-lang/rust/issues/114479. However, I cannot reproduce that trouble any more -- maybe that got fixed by https://github.com/rust-lang/rust/pull/123351?

The  const-float-classify test relied on const traits "because we can", and got disabled when const traits got removed. That's an unfortunate reduction in test coverage of our float functionality, so let's restore the test in a way that does not rely on const traits.

The const-float tests are actually testing runtime behavior as well, and I don't think that runtime behavior is covered anywhere else. Probably they shouldn't be called "const-float", but we don't have a `tests/ui/float` folder... should I create one and move them there? Are there any other ui tests that should be moved there?

I also removed some FIXME referring to not use x87 for Rust-to-Rust-calls -- that has happened in #123351 so this got fixed indeed. Does that mean we can simplify all that float code again? I am not sure how to test it. Is running the test suite with an i586 target enough?

Cc ```@tgross35``` ```@workingjubilee```
2024-09-11 15:53:21 -07:00
Jubilee
abf0ac5ba0
Rollup merge of #129696 - RalfJung:stdarch, r=Amanieu
update stdarch

The goal is mostly to pull in https://github.com/rust-lang/stdarch/pull/1633.

r? ```@Amanieu```
2024-09-11 15:53:21 -07:00
Jubilee
6879ee6818
Rollup merge of #129103 - Nadrieril:dont-warn-empty-unreachable, r=compiler-errors
Don't warn empty branches unreachable for now

The [stabilization](https://github.com/rust-lang/rust/pull/122792) of `min_exhaustive_patterns` updated the `unreachable_pattern` lint to trigger on empty arms too. This has caused some amount of churn, and imposes an unjoyful `#[allow(unreachable_patterns)]` onto library authors who want to stay backwards-compatible.

While I think the lint should eventually cover these cases, for transition's sake I'd prefer to revert linting to what it was prior to stabilization, at least for now.

Fixes https://github.com/rust-lang/rust/issues/129031.

r? ``@compiler-errors``
2024-09-11 15:53:20 -07:00
Nicholas Nethercote
d4fc76cbf3 Introduce 'ra lifetime name.
`rustc_resolve` allocates many things in `ResolverArenas`. The lifetime
used for references into the arena is mostly `'a`, and sometimes `'b`.

This commit changes it to `'ra`, which is much more descriptive. The
commit also changes the order of lifetimes on a couple of structs so
that '`ra` is second last, before `'tcx`, and does other minor
renamings such as `'r` to `'a`.
2024-09-12 08:40:12 +10:00
Michael Goulet
594de02cba Properly deny const gen/async gen fns 2024-09-11 18:39:06 -04:00
Michael Goulet
e866f8a97d Revert 'Stabilize -Znext-solver=coherence' 2024-09-11 17:57:04 -04:00
Michael Goulet
6d064295c8 clippy::useless_conversion 2024-09-11 17:52:53 -04:00
Yuri Astrakhan
368231c995 Limit libc::link usage to nto70 target only, not NTO OS
It seems QNX 7.0 does not support `linkat` at all (most tests were failing). Limiting to QNX 7.0 only, while using `linkat` for the future versions seems like the right path forward (tested on 7.0).

Fixes 129895
2024-09-11 17:35:14 -04:00
Michael Goulet
af8d911d63 Also fix if in else 2024-09-11 17:24:01 -04:00
Ralf Jung
03e8c95809 make basic allocation functions track_caller in Miri for nicer backtraces 2024-09-11 22:38:21 +02:00
onur-ozkan
496709356c unify llvm-bitcode-linker, wasm-component-ld and llvm-tools logics
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-11 22:56:42 +03:00
Samuel Tardieu
6ee87ae594 Use the same span for attributes and Try expansion of ?
This is needed for Clippy to know that the `#[allow(unused)]` attributes
added by the expansion of `?` are part of the desugaring, and that they
do not come from the user code.

rust-lang/rust-clippy#13380 exhibits a manifestation of this problem.
2024-09-11 21:42:32 +02:00
bors
8d6b88b168 Auto merge of #130237 - matthiaskrgr:rollup-qmgr8i7, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #129260 (Don't suggest adding return type for closures with default return type)
 - #129520 (Suggest the correct pattern syntax on usage of unit variant pattern for a struct variant)
 - #129866 (Clarify documentation labelling and definitions for std::collections)
 - #130123 (Report the `note` when specified in `diagnostic::on_unimplemented`)
 - #130161 (refactor merge base logic and fix `x fmt`)
 - #130206 (Map `WSAEDQUOT` to `ErrorKind::FilesystemQuotaExceeded`)
 - #130207 (Map `ERROR_CANT_RESOLVE_FILENAME` to `ErrorKind::FilesystemLoop`)
 - #130219 (Fix false positive with `missing_docs` and `#[test]`)
 - #130221 (Make SearchPath::new public)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-09-11 19:39:45 +00:00
Julius Liu
5527076d84 chore: remove struct details 2024-09-11 12:00:03 -07:00
Ralf Jung
3842ea671b miri: fix overflow detection for unsigned pointer offset 2024-09-11 20:40:55 +02:00
Matthias Krüger
678c249708
Rollup merge of #130221 - vetleras:pub_search_path_new, r=chenyukang
Make SearchPath::new public

I'm writing a tool that uses `rustc_interface`, and would like to construct `SearchPath` with its `new` method.

As all three fields in `SearchPath` are public anyway, the proposed change should not change the privacy or encapsulation of the struct.
2024-09-11 20:04:26 +02:00
Matthias Krüger
66727ea1a2
Rollup merge of #130219 - ogoffart:missing-docs-test, r=Urgau
Fix false positive with `missing_docs` and `#[test]`

Since #130025, the compiler don't ignore missing_docs when compiling the tests. But there is now a false positive warning for every `#[test]`

For example, this code
```rust
//! Crate docs

fn just_a_test() {}
```

Would emit this warning when running `cargo test`

```
warning: missing documentation for a constant
 --> src/lib.rs:5:1
  |
4 | #[test]
  | ------- in this procedural macro expansion
5 | fn just_a_test() {}
  | ^^^^^^^^^^^^^^^^^^^
```
2024-09-11 20:04:25 +02:00
Matthias Krüger
78cf023d8c
Rollup merge of #130207 - GrigorenkoPV:ERROR_CANT_RESOLVE_FILENAME, r=ChrisDenton
Map `ERROR_CANT_RESOLVE_FILENAME` to `ErrorKind::FilesystemLoop`

cc #86442

As summarized in #130188, there seems to be a consensus that this should be done.
2024-09-11 20:04:25 +02:00
Matthias Krüger
e68dadb2ab
Rollup merge of #130206 - GrigorenkoPV:WSAEDQUOT, r=ChrisDenton
Map `WSAEDQUOT` to `ErrorKind::FilesystemQuotaExceeded`

cc #86442

As summarized in #130190, there seems to be a consensus that this should be done.
2024-09-11 20:04:24 +02:00
Matthias Krüger
ff4b3d4780
Rollup merge of #130161 - onur-ozkan:fmt-changed-files, r=Kobzol,RalfJung
refactor merge base logic and fix `x fmt`

When remote upstream is not configured, using [get_git_modified_files](38e3a5771c/src/tools/build_helper/src/git.rs (L114)) to find modified files fails because [get_rust_lang_rust_remote](38e3a5771c/src/tools/build_helper/src/git.rs (L46-L48)) can not resolve "rust-lang/rust" from the git output. The changes in this PR makes bootstrap to find the latest bors commit, treating it as the "closest upstream commit" so that the change tracker logic can use it to find the diffs.

In addition, [skips formatting](e392454483) if there are no modified files.

Fixes #130147
2024-09-11 20:04:24 +02:00
Matthias Krüger
5107ff4322
Rollup merge of #130123 - FedericoBruzzone:master, r=compiler-errors
Report the `note` when specified in `diagnostic::on_unimplemented`

Before this PR the `note` field was completely ignored for some reason, now it is shown (I think) correctly during the hir typechecking phase.

1. Report the `note` when specified in `diagnostic::on_unimplemented`
2. Added a test for unimplemented trait diagnostic
3. Added a test for custom unimplemented trait diagnostic

Close #130084

P.S. This is my first PR to rustc.
2024-09-11 20:04:23 +02:00
Matthias Krüger
6d7ccad93d
Rollup merge of #129866 - root-goblin:patch-1, r=workingjubilee
Clarify documentation labelling and definitions for std::collections

Page affected: https://doc.rust-lang.org/std/collections/index.html#performance

Changes:
- bulleted conventions
- expanded definitions on terms used
- more accessible language
- more informative headings
2024-09-11 20:04:22 +02:00
Matthias Krüger
1d6edee3fc
Rollup merge of #129520 - tunawasabi:suggest-adding-struct-pattern-syntax, r=compiler-errors
Suggest the correct pattern syntax on usage of unit variant pattern for a struct variant

Closes #126243

I add a suggestion on usage of unit variant pattern for a struct variant.
2024-09-11 20:04:22 +02:00
Matthias Krüger
76e070fbd3
Rollup merge of #129260 - wafarm:dont-suggest-closures, r=compiler-errors
Don't suggest adding return type for closures with default return type

Follow up of #129223

r? ``@compiler-errors``
2024-09-11 20:04:21 +02:00
Michael Goulet
954419aab0 Simplify some nested if statements 2024-09-11 13:45:23 -04:00
bors
5bce6d48ff Auto merge of #130197 - RalfJung:interp-perf, r=saethlin
interpret: mark some hot functions inline(always)

That seems to recover a good part of the perf impact of https://github.com/rust-lang/rust/pull/129778.

r? `@saethlin`
2024-09-11 17:02:40 +00:00
Julius Liu
6c8423865f docs: remove struct info 2024-09-11 09:59:05 -07:00
Nadrieril
5b7be148ea Revert warning empty patterns as unreachable 2024-09-11 18:36:45 +02:00
Ralf Jung
db40dc3168 notify Miri when intrinsics are changed 2024-09-11 16:31:05 +02:00
bors
f7f8bdf2e0 Auto merge of #130195 - folkertdev:naked-asm-outside-naked-fn, r=Amanieu
disallow `naked_asm!` outside of `#[naked]` functions

tracking issue: https://github.com/rust-lang/rust/issues/90957
parent PR: https://github.com/rust-lang/rust/pull/128651

I split this out from the parent PR because it's self-contained and because the analysis has to search through all functions and there might be performance regressions.

r? `@Amanieu`
2024-09-11 13:47:26 +00:00
bors
16beabe1e1 Auto merge of #130212 - DianQK:llvm-19, r=nikic
Update LLVM to 19 327ca6c

Fixes #129887.

r? nikic
2024-09-11 10:57:43 +00:00
Olivier Goffart
cc34d64c51 Use doc(hidden) instead of allow(missing_docs) in the test harness
So that it doesn't fail with `forbid(missing_docs)`

Fixes #130218
2024-09-11 12:14:35 +02:00
Olivier Goffart
5d456dfaa1 Use #[doc(hidden)] instead of #[allow(missing_docs)] on the const generated for #[test] 2024-09-11 11:49:27 +02:00
Vetle Rasmussen
9566163364 Make SearchPath::new public 2024-09-11 11:40:01 +02:00
Olivier Goffart
6eddbb704e Fix false positive with missing_docs and #[test]
Since #130025, the compiler don't ignore missing_docs when compiling the tests.
But there is now a false positive warning for every `#[test]`

For example, this code
```rust
//! Crate docs

fn just_a_test() {}
```

Would emit this warning when running `cargo test`

```
warning: missing documentation for a constant
 --> src/lib.rs:5:1
  |
4 | #[test]
  | ------- in this procedural macro expansion
5 | fn just_a_test() {}
  | ^^^^^^^^^^^^^^^^^^^
```
2024-09-11 11:33:10 +02:00
Ralf Jung
542a6c67ae miri: support vector index arguments in simd_shuffle 2024-09-11 11:19:46 +02:00
bors
5a2dd7d4f3 Auto merge of #130194 - lcnr:generalize-cache, r=compiler-errors
generalize: track relevant info in cache key

This was previously theoretically incomplete as we could incorrectly generalize as if the type was in an invariant context even though we're in a covariant one. Similar with the `in_alias` flag.

r? `@compiler-errors`
2024-09-11 07:17:12 +00:00
Ralf Jung
b44f1dd758 update stdarch 2024-09-11 08:35:32 +02:00
onur-ozkan
5f32717649 document the new git logic in more detail
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-11 08:33:34 +03:00
bors
4c5fc2c334 Auto merge of #130050 - cjgillot:expect-attr-id, r=fee1-dead
Enumerate lint expectations using AttrId

This PR implements the idea I outlined in https://github.com/rust-lang/rust/issues/127884#issuecomment-2240338547

We can uniquely identify a lint expectation `#[expect(lint0, lint1...)]` using the `AttrId` and the index of the lint inside the attribute. This PR uses this property in `check_expectations`.

In addition, this PR stops stashing expected diagnostics to wait for the unstable -> stable `LintExpectationId` mapping: if the lint is emitted with an unstable attribute, it must have been emitted by an `eval_always` query (like inside the resolver), so won't be loaded from cache. Decoding an `AttrId` from the on-disk cache ICEs, so we have no risk of accidentally checking an expectation.

Fixes https://github.com/rust-lang/rust/issues/127884

cc `@xFrednet`
2024-09-11 04:49:56 +00:00
bors
a9fb00bfa4 Auto merge of #129975 - notriddle:notriddle/lint-skip, r=GuillaumeGomez
rustdoc: unify the short-circuit on all lints

This is a bit of an experiment to see if it improves perf.
2024-09-11 01:17:54 +00:00
DianQK
7c692e13b1
Update LLVM to 19 327ca6c 2024-09-11 07:59:27 +08:00
Ralf Jung
e556c136f3 clean up internal comments about float semantics
- remove an outdated FIXME
- add reference to floating-point semantics issue

Co-authored-by: Jubilee <workingjubilee@gmail.com>
2024-09-10 16:47:09 -07:00
Ralf Jung
3daa9518d5 enable and extend float-classify test 2024-09-10 16:47:01 -07:00