Commit Graph

237401 Commits

Author SHA1 Message Date
Matthias Krüger
96074bec97
Rollup merge of #117133 - compiler-errors:coherence-constrained, r=oli-obk
Merge `impl_wf_inference` (`check_mod_impl_wf`) check into coherence checking

Problem here is that we call `collect_impl_trait_in_trait_types` when checking `check_mod_impl_wf` which is performed before coherence. Due to the `tcx.sess.track_errors`, since we end up reporting an error, we never actually proceed to coherence checking, where we would be emitting a more useful impl overlap error.

This change means that we may report more errors in some cases, but can at least proceed far enough to leave a useful message for overlapping traits with RPITITs in them.

Fixes #116982

r? types
2023-10-25 17:40:29 +02:00
Matthias Krüger
75efc4fd9e
Rollup merge of #116801 - clubby789:issue-113326-test, r=compiler-errors
Add test for 113326

Closes #113326
Bisecting points to #113636 as the fix
2023-10-25 17:40:28 +02:00
bors
964ff0125b Auto merge of #117165 - RalfJung:miri, r=RalfJung
Miri subtree update

r? `@ghost`
2023-10-25 15:34:13 +00:00
Havard Eidnes
6642b4b1e2 Add support for i586-unknown-netbsd as target.
This restricts instructions to those offered by Pentium,
to support e.g. AMD Geode.

There is already an entry for this target in the NetBSD
platform support page at

  src/doc/rustc/src/platform-support/netbsd.md

...so this should forestall its removal.

Additional fixes are needed for some vendored modules, this
is the changes in the rust compiler core itself.
2023-10-25 15:23:34 +00:00
Antoni Boucher
783789f831 Build the sysroot and run more tests 2023-10-25 11:19:03 -04:00
Oli Scherer
57d6a6f588 Only call mir_const_qualif if absolutely necessary 2023-10-25 14:32:14 +00:00
Oli Scherer
1be0033457 Fix some coroutine sentences that don't make sense anymore.
These happened during the `generator` -> `coroutine` rename.
2023-10-25 14:27:00 +00:00
Guillaume Gomez
c15ad9e7a5 Regenerate intrinsics mapping 2023-10-25 15:53:31 +02:00
bors
b66fe58f68 Auto merge of #117113 - celinval:smir-stable-ty, r=oli-obk
Remove fold code and add `Const::internal()` to StableMIR

We are not planning to support user generated constant in the foreseeable future, so we are cleaning up the fold logic and user created type for now. Users should use `Instance::resolve` in order to trigger monomorphization.

The Instance::resolve was however incomplete, since we weren't handling internalizing constants yet. Thus, I added that.

I decided to keep the `Const` fields private in case we decide to translate them lazily.
2023-10-25 13:19:54 +00:00
Tomasz Miąsko
a9fad1c357 compiletest: Display compilation errors in mir-opt tests 2023-10-25 15:16:43 +02:00
dirreke
32339f8e80 implement C ABI lowering for CSKY 2023-10-25 20:47:06 +08:00
Oli Scherer
beaf46f7e5 Work around the fact that check_mod_type_wf may spuriously return ErrorGuaranteed, even if that error is only emitted by check_modwitem_types 2023-10-25 12:04:54 +00:00
cui fliter
11debd778a Fix problematic comment
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-10-25 19:14:03 +08:00
bors
eb03d40a9c Auto merge of #117102 - devnexen:dfbsd_stack_overflow_upd, r=thomcc
stack_overflow: get_stackp using MAP_STACK flag on dragonflybsd too.
2023-10-25 11:01:24 +00:00
Matthew Jasper
dc3d428a8a Make THIR unused_unsafe lint consistent with MIR
Updates THIR behavior to match the changes from #93678
2023-10-25 10:10:13 +00:00
bors
c2ef35161f Auto merge of #117076 - oli-obk:privacy_visitor_types, r=petrochenkov
Refactor type visitor walking

r? `@petrochenkov`

pulling out the uncontroversial parts of https://github.com/rust-lang/rust/pull/113671
2023-10-25 08:54:09 +00:00
bors
51ae1fe849 Auto merge of #3141 - rust-lang:rustup-2023-10-25, r=RalfJung
Automatic Rustup
2023-10-25 08:04:36 +00:00
Ralf Jung
19c4fa60ea CLOCK_UPTIME_RAW exists on all macos targets, not just the ARM ones 2023-10-25 10:03:09 +02:00
bors
c716f180e8 Auto merge of #116236 - dtolnay:builtinmacrocomment, r=cjgillot
Modernize rustc_builtin_macros generics helpers

- Rustfmt-compatible formatting for the code snippets in comments
- Eliminate an _"Extra scope required"_ obsoleted by NLL
2023-10-25 06:57:37 +00:00
The Miri Conjob Bot
3751fb09c3 Merge from rustc 2023-10-25 05:40:45 +00:00
bors
9c793e18dd Auto merge of #3140 - RalfJung:gamma, r=RalfJung
add some more gamma function tests
2023-10-25 05:32:41 +00:00
The Miri Conjob Bot
c612ba8e29 Preparing for merge from rustc 2023-10-25 05:31:14 +00:00
Ralf Jung
e83c8c1c2b add some more gamma function tests 2023-10-25 07:30:27 +02:00
bors
98108dc26c Auto merge of #116993 - compiler-errors:clause-kind, r=jackh726
Uplift `ClauseKind` and `PredicateKind` into `rustc_type_ir`

Uplift `ClauseKind` and `PredicateKind` into `rustc_type_ir`.

Blocked on #116951

r? `@ghost`
2023-10-25 05:02:04 +00:00
Gurinder Singh
079b290439 Do not suggest 'Trait<Assoc=arg>' when in trait impl
because that would be illegal syntax
2023-10-25 09:11:16 +05:30
Michael Goulet
23341434bd Fix unwrap suggestion for async fn 2023-10-25 02:29:51 +00:00
bors
2e4e2a8f28 Auto merge of #117139 - compiler-errors:vid-lifetimes, r=BoxyUwU
Get rid of `'tcx` lifetime on `ConstVid`, `EffectVid`

These are simply newtyped numbers, so don't really have a reason (per se) to have a lifetime -- `TyVid` and `RegionVid` do not, for example.

The only consequence of this is that we need to use a new key type for `UnifyKey` that mentions `'tcx`. This is already done for `RegionVid`, with `RegionVidKey<'tcx>`, but this `UnifyKey` trait implementation may have been the original reason to give `ConstVid` a lifetime. See the changes to `compiler/rustc_middle/src/infer/unify_key.rs` specifically.

I consider the code cleaner this way, though -- we removed quite a few unnecessary `'tcx` in the process. This also makes it easier to uplift these two ids to `rustc_type_ir`, which I plan on doing in a follow-up PR.

r? `@BoxyUwU`
2023-10-25 02:01:04 +00:00
Meysam
515535a657
Update profile-guided-optimization.md 2023-10-25 08:44:50 +07:00
Meysam
3ecc8c37d4
Update src/doc/rustc/src/profile-guided-optimization.md
Co-authored-by: Jakub Beránek <berykubik@gmail.com>
2023-10-25 08:43:21 +07:00
Meysam
29ec0ec4a6
Update src/doc/rustc/src/profile-guided-optimization.md
Co-authored-by: Jakub Beránek <berykubik@gmail.com>
2023-10-25 08:43:06 +07:00
antoyo
3d9c8afc03
Merge pull request #365 from rust-lang/fix/volatile-load
Fix volatile_load
2023-10-24 21:34:17 -04:00
David Tolnay
1a9ea1f1a5
Expose a non-Symbol way to access current rustc version string 2023-10-24 18:11:20 -07:00
David Tolnay
51f7fbab92
CFG_RELEASE is mandatory, no need for option_env
The same file already contains another env!("CFG_RELEASE") on line 632,
so it's impossible for this crate to compile without CFG_RELEASE set.
2023-10-24 18:04:47 -07:00
David Tolnay
fd8907f9cf
Handle structured stable attribute 'since' version in clippy 2023-10-24 18:00:26 -07:00
Weihang Lo
fd7bbc2aa5
Update cargo 2023-10-24 20:51:13 -04:00
Zalathar
65b0f6adb0 Remove support for alias -Z instrument-coverage
This flag was stabilized in rustc 1.60.0 as `-C instrument-coverage`, but the
old unstable flag was kept around as an alias to ease migration.
2023-10-25 11:37:46 +11:00
Zalathar
bc18509719 coverage: UI test for unstable value -C instrument-coverage=branch 2023-10-25 11:36:45 +11:00
David Tolnay
6933a671d3
Handle structured stable attribute 'since' version in rustdoc 2023-10-24 17:34:59 -07:00
bors
848a387967 Auto merge of #116482 - matthewjasper:thir-unsafeck-inline-constants, r=b-naber
Fix inline const pattern unsafety checking in THIR

Fix THIR unsafety checking of inline constants.
- Steal THIR in THIR unsafety checking (if enabled) instead of MIR lowering.
- Represent inline constants in THIR patterns.
2023-10-25 00:03:57 +00:00
Nicholas Nethercote
a0b0ace061 tidy: add unit tests for alphabetical markers.
This requires introducing `tidy_error_ext!` as an alternative to
`tidy_error!`. It is passed a closure that is called for an error. This
lets tests capture tidy error messages in a buffer instead of printing
them to stderr.

It also requires pulling part of `check` out into a new function
`check_lines`, so that tests can pass in an iterator over some strings
instead of a file.
2023-10-25 10:55:12 +11:00
Antoni Boucher
a93d1b73c6 Fix volatile_load 2023-10-24 19:53:59 -04:00
Nicholas Nethercote
a79a2c729d tidy: some minor improvements.
- Tweak some comments.
- No need to do the `concat!` trick on `START_MARKER` because it's
  immediately followed by `END_MARKER`.
- Fix an off-by-one error in the line number for an error message.
- When a second start marker is found without an intervening end marker,
  after giving an error, treat it as though it ends the section. It's
  hard to know exactly what to do in this case, but it makes unit
  testing this case a little simpler (in the next commit).
- If an end marker occurs without a preceding start marker, issue an
  error.
2023-10-25 10:52:05 +11:00
David Tolnay
7b0e315ae6
Update stability attribute sanity UI test to delete superfluous errors 2023-10-24 15:50:24 -07:00
David Tolnay
ddcb1833ff
Keep track of #[stable] attribute even if version cannot be parsed 2023-10-24 15:50:23 -07:00
David Tolnay
f2ae7b55ae
Store 'since' attribute as parsed Version 2023-10-24 15:50:23 -07:00
Celina G. Val
17f6df9c63 Use IndexMap for handling stable Ty 2023-10-24 15:37:43 -07:00
antoyo
46887f2a84
Merge pull request #364 from rust-lang/doc/target-spec
Fix to be able to use a target specification JSON file and document the process
2023-10-24 18:30:01 -04:00
Celina G. Val
3f60165d27 Remove fold code and add Const::internal()
We are not planning to support user generated constant in the
foreseeable future, so we are removing the Fold logic for now in
favor of the Instance::resolve logic.

The Instance::resolve was however incomplete, since we weren't handling
internalizing constants yet. Thus, I added that.

I decided to keep the Const fields private in case we decide to
translate them lazily.
2023-10-24 14:50:58 -07:00
bors
df871fbf05 Auto merge of #115796 - cjgillot:const-prop-rvalue, r=oli-obk
Generate aggregate constants in DataflowConstProp.
2023-10-24 21:47:53 +00:00
Antoni Boucher
0b6e1332b1 Fix to be able to use a target specification JSON file and document the process 2023-10-24 17:41:44 -04:00