]> git.lizzy.rs Git - rust.git/log
rust.git
20 months agoAuto merge of #101990 - clubby789:dont-machine-apply-placeholder-method, r=compiler...
bors [Thu, 10 Nov 2022 02:05:38 +0000 (02:05 +0000)]
Auto merge of #101990 - clubby789:dont-machine-apply-placeholder-method, r=compiler-errors

Fix auto-application of associated generic functions with placeholders

Fixes #101920

20 months agoremove redundent "<>" for ty::Slice with reference type
Yiming Lei [Fri, 28 Oct 2022 05:38:59 +0000 (22:38 -0700)]
remove redundent "<>" for ty::Slice with reference type
this fix #103271

20 months agoAuto merge of #104215 - Manishearth:rollup-5r957ad, r=Manishearth
bors [Wed, 9 Nov 2022 23:19:55 +0000 (23:19 +0000)]
Auto merge of #104215 - Manishearth:rollup-5r957ad, r=Manishearth

Rollup of 9 pull requests

Successful merges:

 - #101005 (Migrate rustc_codegen_llvm to SessionDiagnostics)
 - #103307 (Add context to compiler error message)
 - #103464 (Add support for custom mir)
 - #103929 (Cleanup Apple-related code in rustc_target)
 - #104015 (Remove linuxkernel targets)
 - #104020 (Limit efiapi calling convention to supported arches)
 - #104156 (Cleanups in autoderef impl)
 - #104171 (Update books)
 - #104184 (Fix `rustdoc --version` when used with download-rustc)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

20 months agomake dropck_outlives into a proper canonicalized type query
Michael Goulet [Wed, 9 Nov 2022 18:46:57 +0000 (18:46 +0000)]
make dropck_outlives into a proper canonicalized type query

20 months agoRemove save_and_restore_in_snapshot_flag
Michael Goulet [Wed, 9 Nov 2022 18:47:39 +0000 (18:47 +0000)]
Remove save_and_restore_in_snapshot_flag

20 months agoDisplay help message when fluent arg was referenced incorrectly
Nilstrieb [Wed, 9 Nov 2022 21:37:17 +0000 (22:37 +0100)]
Display help message when fluent arg was referenced incorrectly

The fluent argument syntax is a little special and easy to get wrong, so
we emit a small help message when someone gets it wrong.

Example:
```
parser_mismatched_closing_delimiter = mismatched closing delimiter: `${delimiter}`
```
panics with
```
thread 'rustc' panicked at 'Encountered errors while formatting message for `parser_mismatched_closing_delimiter`
help: Argument `delimiter` exists but was not referenced correctly. Try using `{$delimiter}` instead
attr: `None`
args: `FluentArgs([("delimiter", String("}"))])`
errors: `[ResolverError(Reference(Message { id: "delimiter", attribute: None }))]`', compiler/rustc_errors/src/translation.rs:123:21
```

20 months agoDon't ICE on operator trait methods with generic methods
Nilstrieb [Wed, 9 Nov 2022 21:00:13 +0000 (22:00 +0100)]
Don't ICE on operator trait methods with generic methods

Emit a fatal error instead.

20 months agorustdoc: sort output to make it deterministic
Michael Howell [Wed, 9 Nov 2022 20:55:52 +0000 (13:55 -0700)]
rustdoc: sort output to make it deterministic

20 months agoRollup merge of #104184 - jyn514:rustdoc-version, r=davidtwco
Manish Goregaokar [Wed, 9 Nov 2022 20:39:07 +0000 (15:39 -0500)]
Rollup merge of #104184 - jyn514:rustdoc-version, r=davidtwco

Fix `rustdoc --version` when used with download-rustc

Previously, rustdoc would unconditionally report the version that *rustc* was compiled with. That showed things like `nightly-2022-10-30`, which wasn't right, since this was a `dev` build compiled from source.

Fix it by changing `rustc_driver::version` to a macro expanded at invocation time.

cc https://github.com/rust-lang/rust/issues/103206#issuecomment-1284123084

20 months agoRollup merge of #104171 - ehuss:update-books, r=ehuss
Manish Goregaokar [Wed, 9 Nov 2022 20:39:06 +0000 (15:39 -0500)]
Rollup merge of #104171 - ehuss:update-books, r=ehuss

Update books

## nomicon

1 commits in 9c73283775466d22208a0b28afcab44db4c0cc10..05532356e7a4dbea2330aabb77611f5179493bb8
2022-09-30 07:31:22 +0900 to 2022-11-05 08:13:14 +0900
- Fix typos and grammatical errors (rust-lang/nomicon#384)

## reference

1 commits in 4ea7c5def38ac81df33a9e48e5637a82a5ac404d..9f0cc13ffcd27c1fbe1ab766a9491e15ddcf4d19
2022-10-25 15:14:36 -0700 to 2022-10-31 04:09:16 -0700
- Add a comma (rust-lang/reference#1289)

## book

12 commits in aa5ee485bd6bd80d205da7c82fcdd776f92fdd51..3f64052c048c6def93b94a2b514ee88bba918744
2022-10-20 16:49:55 -0400 to 2022-11-03 22:13:58 -0400
- Upgrade to Rust 1.65
- Upgrade to Rust 1.64
- Upgrade to Rust 1.63
- New ideas for the issue template to try
- Clarify that the conditional expression is the one under discussion
- Updates from copyedit of ch6
- Made Option&lt;T&gt; error explanation more clear
- Update ch06-01-defining-an-enum
- Upgrade mdbook
- Clarify that user1 can't be used as a whole instance. Fixes rust-lang/book#2978.
- Fix plural and incorrect phrase. Fixes rust-lang/book#3359.
- Updates from copyedit of ch5

## rust-by-example

4 commits in 03491f33375c5a2a1661c7fa4be671fe95ce1249..2b15c0abf2bada6e00553814336bc3e2d8399097
2022-10-21 07:30:08 -0300 to 2022-10-31 08:30:13 -0300
- Remove --edition from src/crates/using_lib.md (rust-lang/rust-by-example#1635)
- upgrade upload-artifact
- Clarify Fn in fn/closures/input_parameters.md (rust-lang/rust-by-example#1634)
- fix: erroneous white spaces in types/cast.md

## rustc-dev-guide

12 commits in 51a37ad19a15709d0601afbac6581f5aea6a45da..d0dc6c97a6486f68bac782fff135086eae6d77ec
2022-10-25 10:18:58 -0700 to 2022-11-07 16:49:22 +0200
- trans -&gt; codegen
- Remove implementation details
- Update some more things and improve wording
- Update query.md
- replace tabs with spaces (rust-lang/rustc-dev-guide#1504)
- align code blocks with their paragraphs
- Fixes some typos (rust-lang/rustc-dev-guide#1502)
- UPDATE - mention of Diagnostic derive on enums
- trans -&gt; codegen (rust-lang/rustc-dev-guide#1500)
- add note for err annotation formatting
- Remove `--bless` from pre-push hook suggestion
- Update for highfive transition.

20 months agoRollup merge of #104156 - oli-obk:autoderef, r=estebank
Manish Goregaokar [Wed, 9 Nov 2022 20:39:06 +0000 (15:39 -0500)]
Rollup merge of #104156 - oli-obk:autoderef, r=estebank

Cleanups in autoderef impl

Just something I noticed. Turns out the `overloaded_span` is not actually used separately from the main span, so I merged them.

20 months agoRollup merge of #104020 - nicholasbishop:bishop-limit-efiapi, r=nagisa
Manish Goregaokar [Wed, 9 Nov 2022 20:39:05 +0000 (15:39 -0500)]
Rollup merge of #104020 - nicholasbishop:bishop-limit-efiapi, r=nagisa

Limit efiapi calling convention to supported arches

Supported architectures in UEFI are described here:
https://uefi.org/specs/UEFI/2.10/02_Overview.html#calling-conventions

https://github.com/rust-lang/rust/issues/65815

20 months agoRollup merge of #104015 - alex:remove-kernel, r=oli-obk
Manish Goregaokar [Wed, 9 Nov 2022 20:39:05 +0000 (15:39 -0500)]
Rollup merge of #104015 - alex:remove-kernel, r=oli-obk

Remove linuxkernel targets

These are not used by the actual Rust-for-Linux project, so they're mostly just confusing.

20 months agoRollup merge of #103929 - BlackHoleFox:apple-targets-cleanup, r=petrochenkov
Manish Goregaokar [Wed, 9 Nov 2022 20:39:04 +0000 (15:39 -0500)]
Rollup merge of #103929 - BlackHoleFox:apple-targets-cleanup, r=petrochenkov

Cleanup Apple-related code in rustc_target

While working on https://github.com/rust-lang/rust/pull/103455, the consistency of the `rustc_target` code for Apple's platforms was "kind of bad." There were two "base" files (`apple_base.rs` and `apple_sdk_base.rs`) that the targets each pulled some parts out of, each and all of them were written slightly differently, and sometimes missed comments other implementations had.

So to hopefully make future maintenance, like implementing https://github.com/rust-lang/compiler-team/issues/556, easier, this makes all of them use similar patterns and the same target base logic everywhere instead of picking bits from both. This also has some other smaller upsides like less stringly-typed functions.

20 months agoRollup merge of #103464 - JakobDegen:mir-parsing, r=oli-obk
Manish Goregaokar [Wed, 9 Nov 2022 20:39:03 +0000 (15:39 -0500)]
Rollup merge of #103464 - JakobDegen:mir-parsing, r=oli-obk

Add support for custom mir

This implements rust-lang/compiler-team#564 . Details about the design, motivation, etc. can be found in there.

r? ```@oli-obk```

20 months agoRollup merge of #103307 - b4den:master, r=estebank
Manish Goregaokar [Wed, 9 Nov 2022 20:39:02 +0000 (15:39 -0500)]
Rollup merge of #103307 - b4den:master, r=estebank

Add context to compiler error message

Changed `creates a temporary which is freed while still in use` to `creates a temporary value which is freed while still in use`.

20 months agoRollup merge of #101005 - SLASHLogin:rustc_codegen_llvm_diagnostics, r=davidtwco
Manish Goregaokar [Wed, 9 Nov 2022 20:39:02 +0000 (15:39 -0500)]
Rollup merge of #101005 - SLASHLogin:rustc_codegen_llvm_diagnostics, r=davidtwco

Migrate rustc_codegen_llvm to SessionDiagnostics

WIP: Port current implementation of diagnostics to the new SessionDiagnostics.

Part of #100717

```@rustbot``` label +A-translation

20 months agoEmit error in `collecting_trait_impl_trait_tys` on mismatched signatures
Nilstrieb [Wed, 9 Nov 2022 20:19:31 +0000 (21:19 +0100)]
Emit error in `collecting_trait_impl_trait_tys` on mismatched signatures

Previously, a `delay_span_bug` was isssued, failing normalization. This
create a `TyKind::Error` in the signature, which caused
`compare_predicate_entailment` to swallow its signature mismatch error,
causing ICEs because no error was emitted.

20 months agoAuto merge of #104131 - notriddle:notriddle/flate2, r=Mark-Simulacrum
bors [Wed, 9 Nov 2022 20:25:28 +0000 (20:25 +0000)]
Auto merge of #104131 - notriddle:notriddle/flate2, r=Mark-Simulacrum

Update to latest version of flate2

20 months agoSuggest is_some or let when encountering Option and bool type mismatch
Michael Goulet [Sun, 6 Nov 2022 01:38:57 +0000 (01:38 +0000)]
Suggest is_some or let when encountering Option and bool type mismatch

20 months ago:arrow_up: rust-analyzer
Laurențiu Nicola [Wed, 9 Nov 2022 19:49:10 +0000 (21:49 +0200)]
:arrow_up: rust-analyzer

20 months agorebase conflict
Michael Goulet [Sat, 5 Nov 2022 18:29:47 +0000 (18:29 +0000)]
rebase conflict

20 months agoMake span_suggestions take IntoIterator
Michael Goulet [Fri, 7 Oct 2022 02:05:57 +0000 (02:05 +0000)]
Make span_suggestions take IntoIterator

20 months agoDiagnosticBuilder -> Diagnostic
Michael Goulet [Thu, 6 Oct 2022 21:39:37 +0000 (21:39 +0000)]
DiagnosticBuilder -> Diagnostic

20 months agoUse ObligationCtxt in expected_inputs_for_expected_outputs
Michael Goulet [Wed, 9 Nov 2022 18:27:20 +0000 (18:27 +0000)]
Use ObligationCtxt in expected_inputs_for_expected_outputs

20 months agoAuto merge of #104192 - Dylan-DPC:rollup-jjo1o80, r=Dylan-DPC
bors [Wed, 9 Nov 2022 16:54:02 +0000 (16:54 +0000)]
Auto merge of #104192 - Dylan-DPC:rollup-jjo1o80, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #103570 (Stabilize integer logarithms)
 - #103694 (Add documentation examples for `pointer::mask`)
 - #103919 (Unescaping cleanups)
 - #103933 (Promote {aarch64,i686,x86_64}-unknown-uefi to Tier 2)
 - #103952 (Don't intra linkcheck reference)
 - #104111 (rustdoc: Add mutable to the description)
 - #104125 (Const Compare for Tuples)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

20 months agoadd 'is_assign_rhs' to avoid weird suggesting 'let'
yukang [Wed, 9 Nov 2022 14:00:22 +0000 (22:00 +0800)]
add 'is_assign_rhs' to avoid weird suggesting 'let'

20 months agoAdd domain size check to fix ICE
Cameron Steffen [Wed, 9 Nov 2022 16:05:38 +0000 (10:05 -0600)]
Add domain size check to fix ICE

20 months agoUpdate to new browser-ui-test version
Guillaume Gomez [Wed, 9 Nov 2022 16:00:05 +0000 (17:00 +0100)]
Update to new browser-ui-test version

20 months agoAdd new option to prevent CORS failures
Guillaume Gomez [Tue, 8 Nov 2022 14:00:48 +0000 (15:00 +0100)]
Add new option to prevent CORS failures

20 months agoUpdate browser-ui-test version to 0.13.1
Guillaume Gomez [Tue, 8 Nov 2022 14:00:34 +0000 (15:00 +0100)]
Update browser-ui-test version to 0.13.1

20 months agoExtend crate-search div GUI tests
Guillaume Gomez [Mon, 7 Nov 2022 17:08:24 +0000 (18:08 +0100)]
Extend crate-search div GUI tests

20 months agoMigrate crate-search element to CSS variables
Guillaume Gomez [Mon, 7 Nov 2022 17:08:14 +0000 (18:08 +0100)]
Migrate crate-search element to CSS variables

20 months agodocs
Boxy [Wed, 9 Nov 2022 14:25:08 +0000 (14:25 +0000)]
docs

20 months agoAdd missing `emitted_at` to the `Diagnostic`
SLASHLogin [Wed, 9 Nov 2022 14:14:58 +0000 (15:14 +0100)]
Add missing `emitted_at` to the `Diagnostic`

20 months agoAdd constructor for `Diagnostic` that takes `Vec<(DiagnosticMessage, Style)>`
SLASHLogin [Wed, 9 Nov 2022 12:47:46 +0000 (13:47 +0100)]
Add constructor for `Diagnostic` that takes `Vec<(DiagnosticMessage, Style)>`

20 months agoUpdate compiler/rustc_codegen_llvm/src/back/archive.rs
SLASHLogin [Tue, 8 Nov 2022 19:32:09 +0000 (20:32 +0100)]
Update compiler/rustc_codegen_llvm/src/back/archive.rs

Co-authored-by: David Wood <agile.lion3441@fuligin.ink>
20 months agoUse `LayoutError`'s implementation of `IntoDiagnostic`
SLASHLogin [Fri, 4 Nov 2022 19:08:01 +0000 (20:08 +0100)]
Use `LayoutError`'s implementation of `IntoDiagnostic`

20 months agoFormatting
SLASHLogin [Thu, 3 Nov 2022 12:41:54 +0000 (13:41 +0100)]
Formatting

20 months agoAdd `replace_args` method for `rustc_errors::diagnostic::Diagnostic`
SLASHLogin [Thu, 3 Nov 2022 12:09:25 +0000 (13:09 +0100)]
Add `replace_args` method for `rustc_errors::diagnostic::Diagnostic`

20 months agoDelay diagnostic translation in `rustc_codegen_ssa`
SLASHLogin [Wed, 2 Nov 2022 18:23:05 +0000 (19:23 +0100)]
Delay diagnostic translation in `rustc_codegen_ssa`

20 months agoSimplify existing Diagnostic implementations
SLASHLogin [Sun, 30 Oct 2022 18:26:12 +0000 (19:26 +0100)]
Simplify existing Diagnostic implementations

20 months agoPort diagnostics created by `Handler`
SLASHLogin [Sun, 30 Oct 2022 15:07:04 +0000 (16:07 +0100)]
Port diagnostics created by `Handler`

20 months agoFlatten diagnostic structs
SLASHLogin [Sun, 30 Oct 2022 13:33:27 +0000 (14:33 +0100)]
Flatten diagnostic structs

20 months agoCorrect tests to match errors
SLASHLogin [Tue, 30 Aug 2022 10:22:08 +0000 (12:22 +0200)]
Correct tests to match errors

20 months agoFix CI
SLASHLogin [Sat, 27 Aug 2022 08:05:50 +0000 (10:05 +0200)]
Fix CI
Add missing 'the' to the error en-US translation

20 months agoPort `MissingFeatures` and `TargetFeatureDisableOrEnable`
SLASHLogin [Fri, 26 Aug 2022 19:27:17 +0000 (21:27 +0200)]
Port `MissingFeatures` and `TargetFeatureDisableOrEnable`

20 months agoPort `UnknownArchiveKind`
SLASHLogin [Fri, 26 Aug 2022 17:42:29 +0000 (19:42 +0200)]
Port `UnknownArchiveKind`

20 months agoPort `DlltoolFailImportLibrary` and implement `IntoDiagnosticArg` for `Cow<'a, str>`
SLASHLogin [Fri, 26 Aug 2022 17:01:22 +0000 (19:01 +0200)]
Port `DlltoolFailImportLibrary` and implement `IntoDiagnosticArg` for `Cow<'a, str>`

20 months agoPort ErrorCallingDllTool
SLASHLogin [Fri, 26 Aug 2022 12:29:33 +0000 (14:29 +0200)]
Port ErrorCallingDllTool

20 months agoImport ErrorWritingDEFFile
SLASHLogin [Fri, 26 Aug 2022 12:17:15 +0000 (14:17 +0200)]
Import ErrorWritingDEFFile

20 months agoPort ArchiveBuildFailure
SLASHLogin [Fri, 26 Aug 2022 12:11:47 +0000 (14:11 +0200)]
Port ArchiveBuildFailure

20 months agoPort SanitizerMemtagRequiresMte
SLASHLogin [Fri, 26 Aug 2022 10:19:10 +0000 (12:19 +0200)]
Port SanitizerMemtagRequiresMte

20 months agoReuse SymbolAlreadyDefined
SLASHLogin [Fri, 26 Aug 2022 09:48:35 +0000 (11:48 +0200)]
Reuse SymbolAlreadyDefined

20 months agoPort LinkageConstOrMutType error
SLASHLogin [Fri, 26 Aug 2022 08:40:48 +0000 (10:40 +0200)]
Port LinkageConstOrMutType error

20 months agoPort InvalidMinimumAlignment
SLASHLogin [Fri, 26 Aug 2022 08:30:43 +0000 (10:30 +0200)]
Port InvalidMinimumAlignment

20 months agoPort layout size overflow
SLASHLogin [Fri, 26 Aug 2022 08:14:15 +0000 (10:14 +0200)]
Port layout size overflow

20 months agoFormatting
SLASHLogin [Thu, 25 Aug 2022 22:08:05 +0000 (00:08 +0200)]
Formatting

20 months agoPort branch protection on aarch64
SLASHLogin [Thu, 25 Aug 2022 22:03:53 +0000 (00:03 +0200)]
Port branch protection on aarch64

20 months agoFix diag() and formatting
SLASHLogin [Thu, 25 Aug 2022 21:47:11 +0000 (23:47 +0200)]
Fix diag() and formatting

20 months agoPort `symbol_already_defined` error
SLASHLogin [Thu, 25 Aug 2022 21:30:17 +0000 (23:30 +0200)]
Port `symbol_already_defined` error

20 months agoPort Instrument coverage requires llvm 12 to the new struct
SLASHLogin [Thu, 25 Aug 2022 21:08:18 +0000 (23:08 +0200)]
Port Instrument coverage requires llvm 12 to the new struct

20 months agoImport `error creating import library`
SLASHLogin [Thu, 25 Aug 2022 19:01:36 +0000 (21:01 +0200)]
Import `error creating import library`

20 months agoMissing lifetime parameter and formatting
SLASHLogin [Thu, 25 Aug 2022 17:23:55 +0000 (19:23 +0200)]
Missing lifetime parameter and formatting

20 months agoChange String in structs to &'a str
SLASHLogin [Thu, 25 Aug 2022 16:36:15 +0000 (18:36 +0200)]
Change String in structs to &'a str

20 months agoTrailing whitespaces
SLASHLogin [Thu, 25 Aug 2022 14:18:06 +0000 (16:18 +0200)]
Trailing whitespaces

20 months agolocales formatting
SLASHLogin [Thu, 25 Aug 2022 14:15:03 +0000 (16:15 +0200)]
locales formatting

20 months agoFormatting
SLASHLogin [Thu, 25 Aug 2022 13:42:20 +0000 (15:42 +0200)]
Formatting

20 months agoPort unknown feature diagnostic to the new framework
SLASHLogin [Thu, 25 Aug 2022 13:34:30 +0000 (15:34 +0200)]
Port unknown feature diagnostic to the new framework

20 months agoRollup merge of #104125 - ink-feather-org:const_cmp_tuples, r=fee1-dead
Dylan DPC [Wed, 9 Nov 2022 13:51:25 +0000 (19:21 +0530)]
Rollup merge of #104125 - ink-feather-org:const_cmp_tuples, r=fee1-dead

Const Compare for Tuples

Makes the impls for Tuples of ~const `PartialEq` types also `PartialEq`, impls for Tuples of ~const `PartialOrd` types also `PartialOrd`, for Tuples of ~const `Ord` types also `Ord`.

behind the `#![feature(const_cmp)]` gate.

~~Do not merge before #104113 is merged because I want to use this feature to clean up the new test that I added there.~~

r? ``@fee1-dead``

20 months agoRollup merge of #104111 - yancyribbens:add-mutable-to-the-description-for-as-simd...
Dylan DPC [Wed, 9 Nov 2022 13:51:24 +0000 (19:21 +0530)]
Rollup merge of #104111 - yancyribbens:add-mutable-to-the-description-for-as-simd-mut, r=scottmcm

rustdoc: Add mutable to the description

Add mutable the description to differentiate [as_simd](https://github.com/rust-lang/rust/blob/master/library/core/src/slice/mod.rs#L3654) from [as_simd_mut](https://github.com/rust-lang/rust/blob/master/library/core/src/slice/mod.rs#L3654).

20 months agoRollup merge of #103952 - ehuss:dont-intra-linkcheck-reference, r=Mark-Simulacrum
Dylan DPC [Wed, 9 Nov 2022 13:51:24 +0000 (19:21 +0530)]
Rollup merge of #103952 - ehuss:dont-intra-linkcheck-reference, r=Mark-Simulacrum

Don't intra linkcheck reference

This removes the reference from the intra-doc link checks. This causes problems if any of the reference content needs to change, it causes the linkchecker to break. The reference has its own broken link check (https://github.com/rust-lang/reference/tree/master/style-check) which uses pulldown-cmark on the source to find actual broken links (instead of false-positives like this regex does).

I think the intra-doc link check could potentially be removed completely, since I think rustdoc is now checking for them well enough. However, it may serve as a decent regression check.

20 months agoRollup merge of #103933 - nicholasbishop:bishop-uefi-tier-2, r=JohnTitor
Dylan DPC [Wed, 9 Nov 2022 13:51:23 +0000 (19:21 +0530)]
Rollup merge of #103933 - nicholasbishop:bishop-uefi-tier-2, r=JohnTitor

Promote {aarch64,i686,x86_64}-unknown-uefi to Tier 2

MCP: https://github.com/rust-lang/compiler-team/issues/555

CC `@dvdhrm`

20 months agoRollup merge of #103919 - nnethercote:unescaping-cleanups, r=matklad
Dylan DPC [Wed, 9 Nov 2022 13:51:22 +0000 (19:21 +0530)]
Rollup merge of #103919 - nnethercote:unescaping-cleanups, r=matklad

Unescaping cleanups

Some code improvements, and some error message improvements.

Best reviewed one commit at a time.

r? ````@matklad````

20 months agoRollup merge of #103694 - WaffleLapkin:mask_doc_example, r=scottmcm
Dylan DPC [Wed, 9 Nov 2022 13:51:22 +0000 (19:21 +0530)]
Rollup merge of #103694 - WaffleLapkin:mask_doc_example, r=scottmcm

Add documentation examples for `pointer::mask`

The examples are somewhat convoluted, but I don't know how to make this better :(

20 months agoRollup merge of #103570 - lukas-code:stabilize-ilog, r=scottmcm
Dylan DPC [Wed, 9 Nov 2022 13:51:21 +0000 (19:21 +0530)]
Rollup merge of #103570 - lukas-code:stabilize-ilog, r=scottmcm

Stabilize integer logarithms

Stabilizes feature `int_log`.

I've also made the functions const stable, because they don't depend on any unstable const features. `rustc_allow_const_fn_unstable` is just there for `Option::expect`, which could be replaced with a `match` and `panic!`. cc ``@rust-lang/wg-const-eval``

closes https://github.com/rust-lang/rust/issues/70887 (tracking issue)

~~blocked on FCP finishing: https://github.com/rust-lang/rust/issues/70887#issuecomment-1289028216~~
FCP finished: https://github.com/rust-lang/rust/issues/70887#issuecomment-1302121266

20 months agoAuto merge of #103723 - CastilloDel:master, r=jackh726
bors [Wed, 9 Nov 2022 13:45:27 +0000 (13:45 +0000)]
Auto merge of #103723 - CastilloDel:master, r=jackh726

Remove allow(rustc::potential_query_instability) in rustc_trait_selection

Related to https://github.com/rust-lang/rust/issues/84447

This PR needs to be benchmarked to check for regressions.

20 months agostruct error E0505
AndyJado [Wed, 9 Nov 2022 12:57:44 +0000 (20:57 +0800)]
struct error E0505

20 months agovar_subdiag refinement
AndyJado [Wed, 9 Nov 2022 12:56:28 +0000 (20:56 +0800)]
var_subdiag refinement

trim old

20 months agoremove old var_span_path_only
AndyJado [Fri, 4 Nov 2022 09:09:14 +0000 (17:09 +0800)]
remove old var_span_path_only

doc comment

20 months agolint auto pass
AndyJado [Wed, 14 Sep 2022 15:07:19 +0000 (23:07 +0800)]
lint auto pass

Revert "lint auto pass"

This reverts commit e58e4466384924c491a932d3f18ef50ffa5a5065.

20 months agoIgnore "Change InferCtxtBuilder from enter to build" in git blame
nils [Wed, 9 Nov 2022 11:48:38 +0000 (12:48 +0100)]
Ignore "Change InferCtxtBuilder from enter to build" in git blame

Because it changed the indentation of many things, this commit caused a lot of diff with no functional changes, so we should ignore it.

20 months agobless clippy
yukang [Wed, 9 Nov 2022 11:23:23 +0000 (19:23 +0800)]
bless clippy

20 months agoCleanup fn trait ref test
onestacked [Wed, 9 Nov 2022 10:35:28 +0000 (11:35 +0100)]
Cleanup fn trait ref test

20 months agoAuto merge of #102565 - jyn514:refactor-build-manifest, r=Mark-Simulacrum
bors [Wed, 9 Nov 2022 10:24:27 +0000 (10:24 +0000)]
Auto merge of #102565 - jyn514:refactor-build-manifest, r=Mark-Simulacrum

Refactor build-manifest to minimize the number of changes needed to add a new component

- Add all components to `PkgType`
- Automate functionality wherever possible, so functions often don't have to be manually edited
- Where that's not possible, use exhaustive matches on `PkgType` instead of adding individual strings.
- Add documentation for how to add a component. Improve the existing documentation for how to test changes.

I tested locally that this generates an identical manifest before and after my change, as follows:
```sh
git checkout d44e14225ab00e164aa9ea9e8d9e1bee40f96b3e
cargo +nightly run --manifest-path src/tools/build-manifest/Cargo.toml build/dist build/manifest-before 1970-01-01 http://example.com nightly
git checkout refactor-build-manifest
cargo +nightly run --manifest-path src/tools/build-manifest/Cargo.toml build/dist build/manifest-before 1970-01-01 http://example.com nightly
sort -u build/manifest-before/channel-rust-nightly.toml | diff - <(sort -u build/manifest-after/channel-rust-nightly.toml)
```
I then verified by hand that the differences before sorting are inconsequential (mostly targets being slightly reordered).

The only change in behavior is that `llvm-tools` is now properly renamed to `llvm-tools-preview`:
```
; sort -u build/manifest-before/channel-rust-nightly.toml | diff - <(sort -u build/manifest-after/channel-rust-nightly.toml)
784a785
> [renames.llvm-tools]
894a896
> to = "llvm-tools-preview"
```

This is based on https://github.com/rust-lang/rust/pull/102241 and should not be merged before.

20 months agofix tests and code cleanup
yukang [Wed, 9 Nov 2022 09:10:33 +0000 (17:10 +0800)]
fix tests and code cleanup

20 months agoFix `rustdoc --version` when used with download-rustc
Joshua Nelson [Wed, 9 Nov 2022 08:52:59 +0000 (02:52 -0600)]
Fix `rustdoc --version` when used with download-rustc

Previously, rustdoc would unconditionally report the version that *rustc* was compiled with.
That showed things like `nightly-2022-10-30`, which wasn't right, since this was a `dev` build compiled from source.

Fix it by changing `rustc_driver::version` to a macro expanded at invocation time.

20 months agoconst Compare Tuples
onestacked [Mon, 7 Nov 2022 20:47:46 +0000 (21:47 +0100)]
const Compare Tuples

20 months agoFix #104086, Tighten the 'introduce new binding' suggestion
yukang [Wed, 9 Nov 2022 08:43:37 +0000 (16:43 +0800)]
Fix #104086, Tighten the 'introduce new binding' suggestion

20 months agoAuto merge of #104180 - fee1-dead-contrib:fix-wf-fndef, r=oli-obk
bors [Wed, 9 Nov 2022 07:37:49 +0000 (07:37 +0000)]
Auto merge of #104180 - fee1-dead-contrib:fix-wf-fndef, r=oli-obk

Use `nominal_obligations_without_const` in wf for FnDef

Fixes #104155.

20 months agoAdd support for custom MIR parsing
Jakob Degen [Wed, 3 Aug 2022 11:30:13 +0000 (04:30 -0700)]
Add support for custom MIR parsing

20 months agoAuto merge of #104179 - Manishearth:rollup-yvsx5hh, r=Manishearth
bors [Wed, 9 Nov 2022 04:43:43 +0000 (04:43 +0000)]
Auto merge of #104179 - Manishearth:rollup-yvsx5hh, r=Manishearth

Rollup of 7 pull requests

Successful merges:

 - #100508 (avoid making substs of type aliases late bound when used as fn args)
 - #101381 (Test that target feature mix up with homogeneous floats is sound)
 - #103353 (Fix Access Violation when using lld & ThinLTO on windows-msvc)
 - #103521 (Avoid possible infinite  loop when next_point reaching the end of file)
 - #103559 (first move on a nested span_label)
 - #103778 (Update several crates for improved support of the new targets)
 - #103827 (Properly remap and check for substs compatibility in `confirm_impl_trait_in_trait_candidate`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

20 months agoParser: Recover from using colon as path separator in imports
Bruno A. Muciño [Wed, 9 Nov 2022 02:13:10 +0000 (20:13 -0600)]
Parser: Recover from using colon as path separator in imports

20 months agoUse `nominal_obligations_without_const` in wf for FnDef
Deadbeef [Wed, 9 Nov 2022 02:08:22 +0000 (02:08 +0000)]
Use `nominal_obligations_without_const` in wf for FnDef

20 months agoRollup merge of #103827 - compiler-errors:rpitit-substs-compat, r=wesleywiser
Manish Goregaokar [Wed, 9 Nov 2022 02:03:54 +0000 (21:03 -0500)]
Rollup merge of #103827 - compiler-errors:rpitit-substs-compat, r=wesleywiser

Properly remap and check for substs compatibility in `confirm_impl_trait_in_trait_candidate`

Fixes #103824

20 months agoRollup merge of #103778 - mati865:update-deps, r=Mark-Simulacrum
Manish Goregaokar [Wed, 9 Nov 2022 02:03:54 +0000 (21:03 -0500)]
Rollup merge of #103778 - mati865:update-deps, r=Mark-Simulacrum

Update several crates for improved support of the new targets

This helps with `*-windows-gnullvm` targets by reducing amount of patching.

20 months agoRollup merge of #103559 - AndyJado:var_span_label, r=davidtwco
Manish Goregaokar [Wed, 9 Nov 2022 02:03:53 +0000 (21:03 -0500)]
Rollup merge of #103559 - AndyJado:var_span_label, r=davidtwco

first move on a nested span_label

trying not to be smart this time.

20 months agoRollup merge of #103521 - chenyukang:yukang/fix-103451-avoid-hang, r=jackh726,wesleywiser
Manish Goregaokar [Wed, 9 Nov 2022 02:03:53 +0000 (21:03 -0500)]
Rollup merge of #103521 - chenyukang:yukang/fix-103451-avoid-hang, r=jackh726,wesleywiser

Avoid possible infinite  loop when next_point reaching the end of file

Fixes #103451
If we return a span with `lo` = `hi`, `span_to_snippet` will always get `Ok("")`, which may introduce infinite loop if we don't care.

This PR make `find_width_of_character_at_span` return `width` with 1, so that `span_to_snippet` will get an `Err`.

20 months agoRollup merge of #103353 - wesleywiser:fix_lld_thinlto_msvc, r=michaelwoerister
Manish Goregaokar [Wed, 9 Nov 2022 02:03:52 +0000 (21:03 -0500)]
Rollup merge of #103353 - wesleywiser:fix_lld_thinlto_msvc, r=michaelwoerister

Fix Access Violation when using lld & ThinLTO on windows-msvc

Users report an AV at runtime of the compiled binary when using lld and ThinLTO on windows-msvc. The AV occurs when accessing a static value which is defined in one crate but used in another. Based on the disassembly of the cross-crate use, it appears that the use is not correctly linked with the definition and is instead assigned a garbage pointer value.

If we look at the symbol tables for each crates' obj file, we can see what is happening:

*lib.obj*:

```
COFF SYMBOL TABLE
...
00E 00000000 SECT2  notype       External     | _ZN10reproducer7memrchr2FN17h612b61ca0e168901E
...
```

*bin.obj*:

```
COFF SYMBOL TABLE
...
010 00000000 UNDEF  notype       External     | __imp__ZN10reproducer7memrchr2FN17h612b61ca0e168901E
...
```

The use of the symbol has the "import" style symbol name but the declaration doesn't generate any symbol with the same name. As a result, linking the files generates a warning from lld:

> rust-lld: warning: bin.obj: locally defined symbol imported: reproducer::memrchr::FN::h612b61ca0e168901 (defined in lib.obj) [LNK4217]

and the symbol reference remains undefined at runtime leading to the AV.

To fix this, we just need to detect that we are performing ThinLTO (and thus, static linking) and omit the `dllimport` attribute on the extern item in LLVM IR.

Fixes #81408

20 months agoRollup merge of #101381 - Urgau:target-mixup-homogenous-floats, r=Amanieu
Manish Goregaokar [Wed, 9 Nov 2022 02:03:52 +0000 (21:03 -0500)]
Rollup merge of #101381 - Urgau:target-mixup-homogenous-floats, r=Amanieu

Test that target feature mix up with homogeneous floats is sound

This pull-request adds a test in `src/test/abi/` that test that target feature mix up with homogeneous floats is sound.

This is basically is ripoff of [src/test/ui/simd/target-feature-mixup.rs](https://github.com/rust-lang/rust/blob/47d1cdb0bcac8e417071ce1929d261efe2399ae2/src/test/ui/simd/target-feature-mixup.rs) but for floats and without `#[repr(simd)]`.

*Extracted from https://github.com/rust-lang/rust/pull/97559 since I don't yet know what to do with that PR.*