Commit Graph

252113 Commits

Author SHA1 Message Date
Yutaro Ohno 3a0d8d8afc parser: reduce visibility of unnecessary public `UnmatchedDelim`
`lexer::UnmatchedDelim` struct in `rustc_parse` is unnecessary public
outside of the crate. This commit reduces the visibility to
`pub(crate)`.

Beside, this removes unnecessary field `expected_delim` that causes
warnings after changing the visibility.
2024-04-08 23:55:48 +09:00
Oli Scherer 3b16ee2568 Ensure we do not accidentally insert new early aborts in the analysis passes 2024-04-08 14:44:10 +00:00
bors ab3dba92db Auto merge of #123628 - matthiaskrgr:rollup-6otgb94, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #115984 (extending filesystem support for Hermit)
 - #120144 (privacy: Stabilize lint `unnameable_types`)
 - #122807 (Add consistency with phrases "meantime" and "mean time")
 - #123089 (Add invariant to VecDeque::pop_* that len < cap if pop successful)
 - #123595 (Documentation fix)
 - #123625 (Stop exporting `TypeckRootCtxt` and `FnCtxt`.)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-08 14:15:48 +00:00
5225225 65df93bbb4
move exit-code to rmake 2024-04-08 14:41:16 +01:00
Matthias Krüger f8252712a5
Rollup merge of #123625 - oli-obk:private_fnctxt, r=fee1-dead
Stop exporting `TypeckRootCtxt` and `FnCtxt`.

While they have many convenient APIs, it is better to expose dedicated functions for them

noticed in #122213
2024-04-08 14:31:12 +02:00
Matthias Krüger 5c3559df63
Rollup merge of #123595 - balaganesh102004:master, r=joboet
Documentation fix

Changed "It must not be an identical residual when interconversion is involved" to "The residual is not mandated to be identical when interconversion is involved." as the previous parenthetical appears to state that the residual is not permitted to be identical when interconversion is involved. However the intention of the original wording was to convey that the residual is not required to be identical when interconversion is involved, which makes more sense contextually.
2024-04-08 14:31:11 +02:00
Matthias Krüger 17c94b5f12
Rollup merge of #123089 - Philippe-Cholet:vecdeque_pop_assume_cap, r=Nilstrieb
Add invariant to VecDeque::pop_* that len < cap if pop successful

Similar to #114370 for VecDeque instead of Vec.

I initially come from https://github.com/rust-itertools/itertools/pull/899 where we noticed that `pop_front;push_back;` was slower than expected so `@scottmcm` suggested I file an issue which lead to https://internals.rust-lang.org/t/vecdeque-pop-front-push-back/20483 where **kornel** mentionned #114334 (fixed by #114370).

This is my first time with codegen tests, I based the test on what was done for Vec.
2024-04-08 14:31:11 +02:00
Matthias Krüger 98fbf86af9
Rollup merge of #122807 - danielhuang:fix-1, r=davidtwco
Add consistency with phrases "meantime" and "mean time"

"mean time" is used in a few places while "meantime" is used everywhere else; this would make usage consistent throughout the codebase.
2024-04-08 14:31:10 +02:00
Matthias Krüger 337be99bb6
Rollup merge of #120144 - petrochenkov:unty, r=davidtwco
privacy: Stabilize lint `unnameable_types`

This is the last piece of ["RFC #2145: Type privacy and private-in-public lints"](https://github.com/rust-lang/rust/issues/48054).

Having unstable lints is not very useful because you cannot even dogfood them in the compiler/stdlib in this case (https://github.com/rust-lang/rust/pull/113284).
The worst thing that may happen when a lint is removed are some `removed_lints` warnings, but I haven't heard anyone suggesting removing this specific lint.

This lint is allow-by-default and is supposed to be enabled explicitly.
Some false positives are expected, because sometimes unnameable types are a legitimate pattern.
This lint also have some unnecessary false positives, that can be fixed - see https://github.com/rust-lang/rust/issues/120146 and https://github.com/rust-lang/rust/issues/120149.

Closes https://github.com/rust-lang/rust/issues/48054.
2024-04-08 14:31:10 +02:00
Matthias Krüger beaca9ce08
Rollup merge of #115984 - hermit-os:fuse, r=m-ou-se
extending filesystem support for Hermit

Extending `std` to create, change and read a directory for Hermit.

Hermit is a tier 3 platform and this PR changes only files, wich are related to the tier 3 platform.
2024-04-08 14:31:09 +02:00
bors 75fd074338 Auto merge of #123608 - Mark-Simulacrum:no-demangle-dbg, r=Kobzol
Remove debuginfo from rustc-demangle too

This is done for the same reason as the other dependencies in this list.
2024-04-08 12:08:17 +00:00
Oli Scherer 18ff131c4e Normalize layout test to protect against android alignment differences 2024-04-08 12:06:28 +00:00
Oli Scherer 84acfe86de Actually create ranged int types in the type system. 2024-04-08 12:02:19 +00:00
Oli Scherer 6b24a9cf70 Test macros 2024-04-08 12:02:12 +00:00
Oli Scherer 1d6cd8daf0 Start handling pattern types at the HIR -> Ty conversion boundary 2024-04-08 12:01:50 +00:00
Oli Scherer c4efc25bfa Thread pattern types through the HIR 2024-04-08 12:00:07 +00:00
Oli Scherer a9edbfda32 Stop exporting `TypeckRootCtxt` and `FnCtxt`.
While they have many convenient APIs, it is better to expose dedicated functions for them
2024-04-08 11:59:13 +00:00
Oli Scherer c340e67dec Add pattern types to parser 2024-04-08 11:57:17 +00:00
Oli Scherer fc27a91880 Add pattern types to ast 2024-04-08 11:54:22 +00:00
Zalathar 4b3538352d Replace branch coverage line anonymization test with MC/DC
We don't need the branch coverage version of this test, but we can recycle is
to make sure that the MC/DC coverage support works as expected.
2024-04-08 21:37:32 +10:00
zhuyunxing 1135cd3e78 Add MC/DC support to coverage test tools 2024-04-08 21:30:03 +10:00
DianQK 166bb1bd46
Don't change the otherwise of the switch 2024-04-08 19:20:07 +08:00
DianQK 928c57dc9a
Add test case for #119014 2024-04-08 19:20:04 +08:00
DianQK f4407370db
Change the return type of `can_simplify` to `Option<()>` 2024-04-08 19:09:57 +08:00
DianQK 032bb742ab
Add comments for `CompareType` 2024-04-08 19:07:53 +08:00
DianQK 254289a16e
Updating the MIR with MirPatch 2024-04-08 19:04:11 +08:00
DianQK e752af765e
Transforms a match containing negative numbers into an assignment statement as well 2024-04-08 19:00:57 +08:00
DianQK 1f061f47e2
Transforms match into an assignment statement 2024-04-08 19:00:53 +08:00
DianQK 7af7458453
Refactor `MatchBranchSimplification` 2024-04-08 18:54:42 +08:00
DianQK badb73b921
Update matches_reduce_branches.rs 2024-04-08 18:54:33 +08:00
Guillaume Gomez 66bc97cc88 Make theme switching closer to reality 2024-04-08 12:14:41 +02:00
Guillaume Gomez cf65764920 Update browser-ui-test version to 0.17.2 2024-04-08 12:14:26 +02:00
Philippe-Cholet 7a2678de7d Add invariant to VecDeque::pop_* that len < cap if pop successful
Similar to #114370 for VecDeque instead of Vec. It now uses `core::hint::assert_unchecked`.
2024-04-08 12:12:13 +02:00
bors 0e5f520788 Auto merge of #123577 - Urgau:prep-work-for-compiletest-check-cfg, r=oli-obk
Do some preparation work for compiletest check-cfg

This PR does several preparation work for having always-on check-cfg in compiletest.

In particular, this PR does two main things:
 - It unifies all the *always-false* cfgs under the `FALSE` cfg (as it seems to be the convention under `tests/ui`)
 - It also removes some useless conditions

This is done ahead of the introduction of the always-on check-cfg in compiletest to reduce the amount of changes in that follow-up work. I also think that this is useful even without that follow-up work.
2024-04-08 09:34:44 +00:00
bors 7a495cc13d Auto merge of #123616 - bzEq:fix-be-test, r=jhpratt
[Test] issue-122805.rs should limit to little endian target

In issue-122805.rs, codegen on big endian target is different from little endian target.
```llvm
%0 = load <8 x i16>, ptr %value, align 2
store <8 x i16> %0, ptr %_0, align 1
ret void
```
This is expected since the conversion is unnecessary on BE target for this case.
2024-04-08 04:16:16 +00:00
Kai Luo d8d1e6ce21 Limited to little endian target 2024-04-08 11:11:11 +08:00
Nikita Popov 1b7342b411 force_array -> is_consecutive
The actual ABI implication here is that in some cases the values
are required to be "consecutive", i.e. must either all be passed
in registers or all on stack (without padding).

Adjust the code to either use Uniform::new() or Uniform::consecutive()
depending on which behavior is needed.

Then, when lowering this in LLVM, skip the [1 x i128] to i128
simplification if is_consecutive is set. i128 is the only case
I'm aware of where this is problematic right now. If we find
other cases, we can extend this (either based on target information
or possibly just by not simplifying for is_consecutive entirely).
2024-04-08 11:31:43 +09:00
Nikita Popov 009280c5e3 Fix argument ABI for overaligned structs on ppc64le
When passing a 16 (or higher) aligned struct by value on ppc64le,
it needs to be passed as an array of `i128` rather than an array
of `i64`. This will force the use of an even starting register.

For the case of a 16 byte struct with alignment 16 it is important
that `[1 x i128]` is used instead of `i128` -- apparently, the
latter will get treated similarly to `[2 x i64]`, not exhibiting
the correct ABI. Add a `force_array` flag to `Uniform` to support
this.

The relevant clang code can be found here:
fe2119a7b0/clang/lib/CodeGen/Targets/PPC.cpp (L878-L884)
fe2119a7b0/clang/lib/CodeGen/Targets/PPC.cpp (L780-L784)

I think the corresponding psABI wording is this:

> Fixed size aggregates and unions passed by value are mapped to as
> many doublewords of the parameter save area as the value uses in
> memory. Aggregrates and unions are aligned according to their
> alignment requirements. This may result in doublewords being
> skipped for alignment.

In particular the last sentence.

Fixes https://github.com/rust-lang/rust/issues/122767.
2024-04-08 11:15:36 +09:00
bors f2c8013393 Auto merge of #123569 - c410-f3r:testsssssss, r=jieyouxu
Move some tests

r? `@petrochenkov`
2024-04-08 02:13:05 +00:00
bors a2c72ce594 Auto merge of #123506 - RalfJung:miri-test-libstd, r=Mark-Simulacrum
check-aux: test core, alloc, std in Miri

Let's see if this works, and how long it takes.
2024-04-08 00:08:44 +00:00
Mark Rousskov f946bf4f2e Remove debuginfo from rustc-demangle too
This is done for the same reason as the other dependencies in this list.
2024-04-07 19:19:11 -04:00
bors f65f84feb0 Auto merge of #123597 - Gbd199:patch-1, r=jhpratt
Fix typo in library/core/src/iter/traits/iterator.rs
2024-04-07 22:04:40 +00:00
Ben Kimock b5b49289e1 Only traverse mono-reachable blocks in cg_clif 2024-04-07 16:46:21 -04:00
Caio ab8994d93e Move tests 2024-04-07 17:38:07 -03:00
Ben Kimock 339f4be046 Only collect mono items from reachable blocks 2024-04-07 14:36:42 -04:00
bors 9d5cdf75aa Auto merge of #123601 - jieyouxu:compiletest-run-rustfix-revisions, r=WaffleLapkin
compiletest: properly handle revisioned run-rustfix tests

Before this PR, if you have a revisioned `//@ run-rustfix` test like `//`@[foo]` run-rustfix`, you would run into an error saying crate name cannot contain `.` characters because the fixed test file trying to be compiled is named `<test-name>.<revision>.fixed`, from which `rustc` infers the crate name to be `<test-name>.<revision>` which is not a valid crate name.

This PR fixes the problem by constructing a synthetic crate name from `<test-name>.<revision>`, by

1. replacing all `-` with `_`, and
2. replacing all `.` with `__`

and pass that constructed crate name with `--crate-name` to rustc to compile the fixed file.

Fixes https://github.com/rust-lang/rust/issues/123596.
2024-04-07 18:22:55 +00:00
许杰友 Jieyou Xu (Joe) de3857e553 tests/ui: remove workaround for broken revisioned run-rustfix test 2024-04-07 17:06:15 +00:00
许杰友 Jieyou Xu (Joe) 5dc276c0da compiletest: properly handle revisioned run-rustfix tests 2024-04-07 17:06:15 +00:00
Gabriel Dolberg a1d4066e53
Fix typo in library/core/src/iter/traits/iterator.rs 2024-04-07 18:55:28 +03:00
许杰友 Jieyou Xu (Joe) d4aeff711e Port over backtrace's `line-tables-only` test to a ui test 2024-04-07 15:25:38 +00:00