]> git.lizzy.rs Git - rust.git/log
rust.git
16 months agoAuto merge of #107303 - compiler-errors:intern-canonical-var-values, r=lcnr
bors [Sat, 28 Jan 2023 19:41:21 +0000 (19:41 +0000)]
Auto merge of #107303 - compiler-errors:intern-canonical-var-values, r=lcnr

Intern `CanonicalVarValues`

So that they are copy :sparkles:

16 months agovec: Use SpecCloneIntoVec::clone_into to implement Vec::clone_from
Neil Roberts [Sat, 28 Jan 2023 13:52:31 +0000 (14:52 +0100)]
vec: Use SpecCloneIntoVec::clone_into to implement Vec::clone_from

In the past, Vec::clone_from was implemented using slice::clone_into.
The code from clone_into was later duplicated into clone_from in
8725e4c337, which is the commit that adds custom allocator support to
Vec. Presumably this was done because the slice::clone_into only works
for vecs with the default allocator so it would have the wrong type to
clone into Vec<T, A>.

Now that the clone_into implementation is moved out into a specializable
trait anyway we might as well use that to share the code between the two
methods.

16 months agoslice: Add a specialization for clone_into when T is Copy
Neil Roberts [Sat, 28 Jan 2023 13:19:01 +0000 (14:19 +0100)]
slice: Add a specialization for clone_into when T is Copy

The implementation for the ToOwned::clone_into method on [T] is a copy
of the code for vec::clone_from. In 361398009be6 the code for
vec::clone_from gained a specialization for when T is Copy. This commit
copies that specialization over to the clone_into implementation.

16 months agoAuto merge of #107206 - cjgillot:no-h2l-map, r=WaffleLapkin
bors [Sat, 28 Jan 2023 16:11:33 +0000 (16:11 +0000)]
Auto merge of #107206 - cjgillot:no-h2l-map, r=WaffleLapkin

Remove HirId -> LocalDefId map from HIR.

Having this map in HIR prevents the creating of new definitions after HIR has been built.
Thankfully, we do not need it.

Based on https://github.com/rust-lang/rust/pull/103902

16 months agoReintroduce multiple_supertrait_upcastable lint
Gary Guo [Fri, 9 Dec 2022 02:27:03 +0000 (02:27 +0000)]
Reintroduce multiple_supertrait_upcastable lint

16 months agoRename `is_object_safe` to `check_is_object_safe` to hint side effects
Gary Guo [Sat, 28 Jan 2023 15:07:21 +0000 (15:07 +0000)]
Rename `is_object_safe` to `check_is_object_safe` to hint side effects

16 months agoMake `is_object_safe` a query and move lint_object_unsafe_trait call there
Gary Guo [Thu, 29 Dec 2022 09:53:25 +0000 (09:53 +0000)]
Make `is_object_safe` a query and move lint_object_unsafe_trait call there

16 months agoReplace `object_safety_violations().is_empty()` calls with `is_object_safe`
Gary Guo [Thu, 29 Dec 2022 09:52:46 +0000 (09:52 +0000)]
Replace `object_safety_violations().is_empty()` calls with `is_object_safe`

16 months agomake more pleasant to read
Tshepang Mbambo [Sat, 28 Jan 2023 14:35:07 +0000 (16:35 +0200)]
make more pleasant to read

17 months agoAuto merge of #107408 - matthiaskrgr:rollup-b5vz2ow, r=matthiaskrgr
bors [Sat, 28 Jan 2023 13:12:59 +0000 (13:12 +0000)]
Auto merge of #107408 - matthiaskrgr:rollup-b5vz2ow, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #104012 (Improve unexpected close and mismatch delimiter hint in TokenTreesReader)
 - #104252 (Stabilize the const_socketaddr feature)
 - #105524 (Replace libc::{type} with crate::ffi::{type})
 - #107096 (Detect references to non-existant messages in Fluent resources)
 - #107355 (Add regression test for #60755)
 - #107384 (Remove `BOOL_TY_FOR_UNIT_TESTING`)
 - #107385 (Use `FallibleTypeFolder` for `ConstInferUnifier` not `TypeRelation`)
 - #107391 (rustdoc: remove inline javascript from copy-path button)
 - #107398 (Remove `ControlFlow::{BREAK, CONTINUE}`)

Failed merges:

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

17 months agoUse field-less variant for AliasBound.
Lenko Donchev [Sat, 28 Jan 2023 12:00:27 +0000 (06:00 -0600)]
Use field-less variant for AliasBound.

17 months agoRollup merge of #107398 - scottmcm:its-their-funeral, r=dtolnay
Matthias Krüger [Sat, 28 Jan 2023 10:11:09 +0000 (11:11 +0100)]
Rollup merge of #107398 - scottmcm:its-their-funeral, r=dtolnay

Remove `ControlFlow::{BREAK, CONTINUE}`

Libs-API decided to remove these in #102697.

Follow-up to #107023, which removed them from `compiler/`, but a couple new ones showed up since that was merged.

r? libs

17 months agoRollup merge of #107391 - notriddle:notriddle/copy-path-button, r=GuillaumeGomez
Matthias Krüger [Sat, 28 Jan 2023 10:11:09 +0000 (11:11 +0100)]
Rollup merge of #107391 - notriddle:notriddle/copy-path-button, r=GuillaumeGomez

rustdoc: remove inline javascript from copy-path button

17 months agoRollup merge of #107385 - BoxyUwU:ConstInferUnifier_is_folder, r=compiler-errors
Matthias Krüger [Sat, 28 Jan 2023 10:11:08 +0000 (11:11 +0100)]
Rollup merge of #107385 - BoxyUwU:ConstInferUnifier_is_folder, r=compiler-errors

Use `FallibleTypeFolder` for `ConstInferUnifier` not `TypeRelation`

I am not sure why this was using a `TypeRelation`, maybe it predates the ability to have fallible type folders

17 months agoRollup merge of #107384 - Nilstrieb:bool-for-deletion, r=oli-obk
Matthias Krüger [Sat, 28 Jan 2023 10:11:08 +0000 (11:11 +0100)]
Rollup merge of #107384 - Nilstrieb:bool-for-deletion, r=oli-obk

Remove `BOOL_TY_FOR_UNIT_TESTING`

It is not used anymore for unit testing.

17 months agoRollup merge of #107355 - JohnTitor:issue-60755, r=compiler-errors
Matthias Krüger [Sat, 28 Jan 2023 10:11:07 +0000 (11:11 +0100)]
Rollup merge of #107355 - JohnTitor:issue-60755, r=compiler-errors

Add regression test for #60755

Closes #60755
r? compiler-errors
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
17 months agoRollup merge of #107096 - clubby789:fluent-bad-messageref, r=compiler-errors
Matthias Krüger [Sat, 28 Jan 2023 10:11:07 +0000 (11:11 +0100)]
Rollup merge of #107096 - clubby789:fluent-bad-messageref, r=compiler-errors

Detect references to non-existant messages in Fluent resources

Should help with cases like #107091, where `{variable}` (a message reference) is accidentally typed, rather than `{$variable}` (a variable reference)

Fixes #107370

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

17 months agoRollup merge of #105524 - Ayush1325:libc-free, r=ChrisDenton
Matthias Krüger [Sat, 28 Jan 2023 10:11:06 +0000 (11:11 +0100)]
Rollup merge of #105524 - Ayush1325:libc-free, r=ChrisDenton

Replace libc::{type} with crate::ffi::{type}

Replace libc::{type} imports with crate::ffi::{type} outside of `std::sys` and `std::os`.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
17 months agoRollup merge of #104252 - faern:stabilize-const_socketaddr, r=JohnTitor
Matthias Krüger [Sat, 28 Jan 2023 10:11:06 +0000 (11:11 +0100)]
Rollup merge of #104252 - faern:stabilize-const_socketaddr, r=JohnTitor

Stabilize the const_socketaddr feature

Stabilizes `#![feature(const_socketaddr)]`. Tracking issue: #82485
Closes #82485

This has been unstably const for over a year now. And the code change simplifying the constness of the `new` constructors has been in stable Rust since 1.64 (a bit over a full release cycle). I'm not aware of any blockers to this stabilization.

17 months agoRollup merge of #104012 - chenyukang:yukang/fix-103882-deli-indentation, r=petrochenkov
Matthias Krüger [Sat, 28 Jan 2023 10:11:05 +0000 (11:11 +0100)]
Rollup merge of #104012 - chenyukang:yukang/fix-103882-deli-indentation, r=petrochenkov

Improve unexpected close and mismatch delimiter hint in TokenTreesReader

Fixes #103882
Fixes #68987
Fixes #69259

The inner indentation mismatching will be covered by outer block, the new added function `report_error_prone_delim_block` will find out the error prone candidates for reporting.

17 months agoAuto merge of #106916 - lukas-code:overlapping-substs, r=estebank
bors [Sat, 28 Jan 2023 10:00:56 +0000 (10:00 +0000)]
Auto merge of #106916 - lukas-code:overlapping-substs, r=estebank

Remove overlapping parts of multipart suggestions

This PR adds a debug assertion that the parts of a single substitution cannot overlap, fixes a overlapping substitution from the testsuite, and fixes https://github.com/rust-lang/rust/issues/106870.

Note that a single suggestion can still have multiple overlapping substitutions / possible edits, we just don't suggest overlapping replacements in a single edit anymore.

I've also included a fix for an unrelated bug where rustfix for `explicit_outlives_requirements` would produce multiple trailing commas for a where clause.

17 months agoAdapt ui-fulldeps.
Camille GILLOT [Sun, 22 Jan 2023 18:45:37 +0000 (18:45 +0000)]
Adapt ui-fulldeps.

17 months agoRemove `HirId -> LocalDefId` map from HIR.
Camille GILLOT [Sat, 5 Nov 2022 15:33:58 +0000 (15:33 +0000)]
Remove `HirId -> LocalDefId` map from HIR.

17 months agoTake a LocalDefId in hir::Visitor::visit_fn.
Camille GILLOT [Sun, 22 Jan 2023 18:00:33 +0000 (18:00 +0000)]
Take a LocalDefId in hir::Visitor::visit_fn.

17 months agoOnly compute mir_generator_witnesses query in drop_tracking_mir mode.
Camille GILLOT [Sat, 28 Jan 2023 08:41:22 +0000 (08:41 +0000)]
Only compute mir_generator_witnesses query in drop_tracking_mir mode.

17 months agoAuto merge of #107400 - matthiaskrgr:rollup-l6bycds, r=matthiaskrgr
bors [Sat, 28 Jan 2023 06:46:42 +0000 (06:46 +0000)]
Auto merge of #107400 - matthiaskrgr:rollup-l6bycds, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #107022 (Implement `SpecOptionPartialEq` for `cmp::Ordering`)
 - #107100 (Use proper `InferCtxt` when probing for associated types in astconv)
 - #107103 (Use new solver in `evaluate_obligation` query (when new solver is enabled))
 - #107190 (Recover from more const arguments that are not wrapped in curly braces)
 - #107306 (Correct suggestions for closure arguments that need a borrow)
 - #107339 (internally change regions to be covariant)
 - #107344 (Minor tweaks in the new solver)
 - #107373 (Don't merge vtables when full debuginfo is enabled.)

Failed merges:

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

17 months agoReplace libc::{type} with crate::ffi::{type}
Ayush Singh [Sat, 10 Dec 2022 08:04:19 +0000 (13:34 +0530)]
Replace libc::{type} with crate::ffi::{type}

Replace libc::{type} imports with crate::ffi::{type} outside of
`std::sys` and `std::os`.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
17 months agoremove the usize field from CandidateSource::AliasBound
Lenko Donchev [Sat, 28 Jan 2023 04:50:24 +0000 (22:50 -0600)]
remove the usize field from CandidateSource::AliasBound

17 months agoRemove from librustdoc and clippy too
Scott McMurray [Sat, 28 Jan 2023 04:02:51 +0000 (20:02 -0800)]
Remove from librustdoc and clippy too

17 months agoRollup merge of #107373 - michaelwoerister:dont-merge-vtables-when-debuginfo, r=Waffl...
Matthias Krüger [Sat, 28 Jan 2023 04:20:19 +0000 (05:20 +0100)]
Rollup merge of #107373 - michaelwoerister:dont-merge-vtables-when-debuginfo, r=WaffleLapkin

Don't merge vtables when full debuginfo is enabled.

This PR makes the compiler not emit the `unnamed_addr` attribute for vtables when full debuginfo is enabled, so that they don't get merged even if they have the same contents. This allows debuggers to more reliably map from a dyn pointer to the self-type of a trait object by looking at the vtable's debuginfo.

The PR only changes the behavior of the LLVM backend as other backends don't emit vtable debuginfo (as far as I can tell).

The performance impact of this change should be small as [measured](https://github.com/rust-lang/rust/pull/103514#issuecomment-1290833854) in a previous PR.

17 months agoRollup merge of #107344 - compiler-errors:new-solver-tweaks, r=lcnr
Matthias Krüger [Sat, 28 Jan 2023 04:20:19 +0000 (05:20 +0100)]
Rollup merge of #107344 - compiler-errors:new-solver-tweaks, r=lcnr

Minor tweaks in the new solver

1. `InferCtxt::probe` is not needed in `compute_subtype_goal` and `compute_well_formed_goal`.
2. Add a handful of comments.
3. Add a micro-optimization in `consider_assumption` where we check the def-ids of the assumption and goal match before instantiating any binders.

r? ``@lcnr``

17 months agoRollup merge of #107339 - aliemjay:covariant, r=lcnr
Matthias Krüger [Sat, 28 Jan 2023 04:20:18 +0000 (05:20 +0100)]
Rollup merge of #107339 - aliemjay:covariant, r=lcnr

internally change regions to be covariant

Surprisingly, we consider the reference type `&'a T` to be contravaraint in its lifetime parameter. This is confusing and conflicts with the documentation we have in the reference, rustnomicon, and rustc-dev-guide. This also arguably not the correct use of terminology since we can use `&'static u8` in a place where `&' a u8` is expected, this implies that `&'static u8 <: &' a u8` and consequently `'static <: ' a`, hence covariance.

Because of this, when relating two types, we used to switch the argument positions in a confusing way:
`Subtype(&'a u8 <: &'b u8) => Subtype('b <: 'a) => Outlives('a: 'b) => RegionSubRegion('b <= 'a)`

The reason for the current behavior is probably that we wanted `Subtype('b <: 'a)` and `RegionSubRegion('b <= 'a)` to be equivalent, but I don' t think this is a good reason since these relations are sufficiently different in that the first is a relation in the subtyping lattice and is intrinsic to the type-systems, while the the second relation is an implementation detail of regionck.

This PR changes this behavior to use covariance, so..
`Subtype(&'a u8 <: &'b u8) => Subtype('a <: 'b) => Outlives('a: 'b) => RegionSubRegion('b <= 'a) `

Resolves #103676

r? `@lcnr`

17 months agoRollup merge of #107306 - compiler-errors:correct-sugg-for-closure-arg-needs-borrow...
Matthias Krüger [Sat, 28 Jan 2023 04:20:18 +0000 (05:20 +0100)]
Rollup merge of #107306 - compiler-errors:correct-sugg-for-closure-arg-needs-borrow, r=oli-obk

Correct suggestions for closure arguments that need a borrow

Fixes #107301 by dealing with binders correctly
Fixes another issue where we were suggesting adding just `&` when we expected `&mut _` in a closure arg

17 months agoRollup merge of #107190 - fmease:fix-81698, r=compiler-errors
Matthias Krüger [Sat, 28 Jan 2023 04:20:17 +0000 (05:20 +0100)]
Rollup merge of #107190 - fmease:fix-81698, r=compiler-errors

Recover from more const arguments that are not wrapped in curly braces

Recover from some array, borrow, tuple & arithmetic expressions in const argument positions that lack curly braces and provide a suggestion to fix the issue continuing where #92884 left off. Examples of such expressions: `[]`, `[0]`, `[1, 2]`, `[0; 0xff]`, `&9`, `("", 0)` and `(1 + 2) * 3` (we previously did not recover from them).

I am not entirely happy with my current solution because the code that recovers from `[0]` (coinciding with a malformed slice type) and `[0; 0]` (coinciding with a malformed array type) is quite fragile as the aforementioned snippets are actually successfully parsed as types by `parse_ty` since it itself already recovers from them (returning `[⟨error⟩]` and `[⟨error⟩; 0]` respectively) meaning I have to manually look for `TyKind::Err`s and construct a separate diagnostic for the suggestion to attach to (thereby emitting two diagnostics in total).

Fixes #81698.
`@rustbot` label A-diagnostics
r? diagnostics

17 months agoRollup merge of #107103 - compiler-errors:new-solver-evaluate_obligation, r=lcnr
Matthias Krüger [Sat, 28 Jan 2023 04:20:16 +0000 (05:20 +0100)]
Rollup merge of #107103 - compiler-errors:new-solver-evaluate_obligation, r=lcnr

Use new solver in `evaluate_obligation` query (when new solver is enabled)

(only when `-Ztrait-solver=next`, of course)

... Does this make sense? It seems to me like it should be reasonable, but maybe there's some reason why this is a bad idea.

r? ``@lcnr``

Needs a perf run because I guess this `solver == TraitSolver::Next` check is on a hot path.

17 months agoRollup merge of #107100 - compiler-errors:issue-107087, r=lcnr
Matthias Krüger [Sat, 28 Jan 2023 04:20:16 +0000 (05:20 +0100)]
Rollup merge of #107100 - compiler-errors:issue-107087, r=lcnr

Use proper `InferCtxt` when probing for associated types in astconv

Fixes #107087

17 months agoRollup merge of #107022 - scottmcm:ordering-option-eq, r=m-ou-se
Matthias Krüger [Sat, 28 Jan 2023 04:20:15 +0000 (05:20 +0100)]
Rollup merge of #107022 - scottmcm:ordering-option-eq, r=m-ou-se

Implement `SpecOptionPartialEq` for `cmp::Ordering`

Noticed as I continue to explore options for having code using `partial_cmp` optimize better.

Before:
```llvm
; Function Attrs: mustprogress nofree nosync nounwind willreturn uwtable
define noundef zeroext i1 `@ordering_eq(i8` noundef %0, i8 noundef %1) unnamed_addr #0 {
start:
  %2 = icmp eq i8 %0, 2
  br i1 %2, label %bb1.i, label %bb3.i

bb1.i:                                            ; preds = %start
  %3 = icmp eq i8 %1, 2
  br label %"_ZN55_$LT$T$u20$as$u20$core..option..SpecOptionPartialEq$GT$2eq17hb7e7beacecde585fE.exit"

bb3.i:                                            ; preds = %start
  %.not.i = icmp ne i8 %1, 2
  %4 = icmp eq i8 %0, %1
  %spec.select.i = and i1 %.not.i, %4
  br label %"_ZN55_$LT$T$u20$as$u20$core..option..SpecOptionPartialEq$GT$2eq17hb7e7beacecde585fE.exit"

"_ZN55_$LT$T$u20$as$u20$core..option..SpecOptionPartialEq$GT$2eq17hb7e7beacecde585fE.exit": ; preds = %bb1.i, %bb3.i
  %.0.i = phi i1 [ %3, %bb1.i ], [ %spec.select.i, %bb3.i ]
  ret i1 %.0.i
}
```

After:
```llvm
; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn uwtable
define noundef zeroext i1 `@ordering_eq(i8` noundef %0, i8 noundef %1) unnamed_addr #1 {
start:
  %2 = icmp eq i8 %0, %1
  ret i1 %2
}
```

(Which <https://alive2.llvm.org/ce/z/-rop5r> says LLVM *could* just do itself, but there's probably an issue already open for that problem from when this was originally looked at for `Option<NonZeroU8>` and friends.)

17 months agoAuto merge of #107360 - bjorn3:fix_thin_archive_reading, r=wesleywiser
bors [Sat, 28 Jan 2023 04:02:25 +0000 (04:02 +0000)]
Auto merge of #107360 - bjorn3:fix_thin_archive_reading, r=wesleywiser

Fix thin archive reading

This includes a revert of https://github.com/rust-lang/rust/pull/105221 to restore fat archive reading with LlvmArchiveBuilder.

Should fix #107162, #107334 and https://github.com/google/shaderc-rs/issues/133

17 months agoRemove `ControlFlow::{BREAK, CONTINUE}`
Scott McMurray [Sat, 28 Jan 2023 03:46:42 +0000 (19:46 -0800)]
Remove `ControlFlow::{BREAK, CONTINUE}`

Libs-API decided to remove these in #102697.

Follow-up to #107023, which removed them from `compiler/`, but a couple new ones showed up since that was merged.

17 months agoLink to the LLVM issue from a comment on `SpecOptionPartialEq`
Scott McMurray [Sat, 28 Jan 2023 03:09:52 +0000 (19:09 -0800)]
Link to the LLVM issue from a comment on `SpecOptionPartialEq`

17 months agoAuto merge of #101692 - cjgillot:generator-lazy-witness, r=oli-obk
bors [Sat, 28 Jan 2023 01:05:29 +0000 (01:05 +0000)]
Auto merge of #101692 - cjgillot:generator-lazy-witness, r=oli-obk

Compute generator saved locals on MIR

Generators are currently type-checked by introducing a `witness` type variable, which is unified with a `GeneratorWitness(captured types)` whose purpose is to ensure that the auto traits correctly migrate from the captured types to the `witness` type.  This requires computing the captured types on HIR during type-checking, only to re-do it on MIR later.

This PR proposes to drop the HIR-based computation, and only keep the MIR one.  This is done in 3 steps.
1. During type-checking, the `witness` type variable is never unified.  This allows to stall all the obligations that depend on it until the end of type-checking.  Then, the stalled obligations are marked as successful, and saved into the typeck results for later verification.
2. At type-checking writeback, `witness` is replaced by `GeneratorWitnessMIR(def_id, substs)`.  From this point on, all trait selection involving `GeneratorWitnessMIR` will fetch the MIR-computed locals, similar to what opaque types do.  There is no lifetime to be preserved here: we consider all the lifetimes appearing in this witness type to be higher-ranked.
3. After borrowck, the stashed obligations are verified against the actually computed types, in the `check_generator_obligations` query.  If any obligation was wrongly marked as fulfilled in step 1, it should be reported here.

There are still many issues:
- ~I am not too happy having to filter out some locals from the checked bounds, I think this is MIR building that introduces raw pointers polluting the analysis;~ solved by a check specific to static variables.
- the diagnostics for captured types don't show where they are used/dropped;
- I do not attempt to support chalk.

cc `@eholk` `@jyn514` for the drop-tracking work
r? `@oli-obk` as you warned me of potential unsoundness

17 months agorustdoc: remove inline javascript from copy-path button
Michael Howell [Fri, 27 Jan 2023 21:23:28 +0000 (14:23 -0700)]
rustdoc: remove inline javascript from copy-path button

17 months agoBless mir-opt tests.
Camille GILLOT [Sat, 21 Jan 2023 14:26:44 +0000 (14:26 +0000)]
Bless mir-opt tests.

17 months agoPacify tidy.
Camille GILLOT [Sat, 21 Jan 2023 10:12:11 +0000 (10:12 +0000)]
Pacify tidy.

17 months agoRestrict amount of ignored locals.
Camille GILLOT [Sat, 21 Jan 2023 10:03:12 +0000 (10:03 +0000)]
Restrict amount of ignored locals.

17 months agoAuto merge of #107386 - flip1995:clippyup, r=Manishearth
bors [Fri, 27 Jan 2023 21:20:39 +0000 (21:20 +0000)]
Auto merge of #107386 - flip1995:clippyup, r=Manishearth

Update Clippy

r? `@Manishearth`

17 months agoaddress review
b-naber [Fri, 27 Jan 2023 21:13:55 +0000 (22:13 +0100)]
address review

17 months agoBless ui-fulldeps.
Camille GILLOT [Sat, 1 Oct 2022 17:57:39 +0000 (19:57 +0200)]
Bless ui-fulldeps.

17 months agoBless tests.
Camille GILLOT [Thu, 26 Jan 2023 03:51:26 +0000 (03:51 +0000)]
Bless tests.

17 months agoCompute generator saved locals on MIR.
Camille GILLOT [Sat, 1 Oct 2022 13:57:22 +0000 (15:57 +0200)]
Compute generator saved locals on MIR.

17 months agoUpdate Cargo.lock
Philipp Krones [Fri, 27 Jan 2023 20:09:23 +0000 (21:09 +0100)]
Update Cargo.lock

17 months agoMerge commit '1480cea393d0cee195e59949eabdfbcf1230f7f9' into clippyup
Philipp Krones [Fri, 27 Jan 2023 20:09:08 +0000 (21:09 +0100)]
Merge commit '1480cea393d0cee195e59949eabdfbcf1230f7f9' into clippyup

17 months agoMicro-optimization in consider_assumption
Michael Goulet [Fri, 27 Jan 2023 04:32:12 +0000 (04:32 +0000)]
Micro-optimization in consider_assumption

17 months agoAdd some comments
Michael Goulet [Fri, 27 Jan 2023 04:31:51 +0000 (04:31 +0000)]
Add some comments

17 months agoNo need to probe when computing goals
Michael Goulet [Fri, 27 Jan 2023 04:00:37 +0000 (04:00 +0000)]
No need to probe when computing goals

17 months agoRemove unused import
nils [Fri, 27 Jan 2023 19:58:54 +0000 (20:58 +0100)]
Remove unused import

17 months agoAuto merge of #10242 - flip1995:rustup, r=flip1995
bors [Fri, 27 Jan 2023 19:31:37 +0000 (19:31 +0000)]
Auto merge of #10242 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: none

17 months agoyeet
Boxy [Fri, 27 Jan 2023 19:29:04 +0000 (19:29 +0000)]
yeet

17 months agoBump Clippy version -> 0.1.69
Philipp Krones [Fri, 27 Jan 2023 19:27:00 +0000 (20:27 +0100)]
Bump Clippy version -> 0.1.69

17 months agoBump nightly version -> 2023-01-27
Philipp Krones [Fri, 27 Jan 2023 19:26:48 +0000 (20:26 +0100)]
Bump nightly version -> 2023-01-27

17 months agoMerge remote-tracking branch 'upstream/master' into rustup
Philipp Krones [Fri, 27 Jan 2023 19:21:37 +0000 (20:21 +0100)]
Merge remote-tracking branch 'upstream/master' into rustup

17 months agoRemove `BOOL_TY_FOR_UNIT_TESTING`
Nilstrieb [Fri, 27 Jan 2023 19:22:54 +0000 (20:22 +0100)]
Remove `BOOL_TY_FOR_UNIT_TESTING`

It is not used anymore for unit testing.

17 months agoSeparate witness type computation from the generator transform.
Camille GILLOT [Tue, 26 Jul 2022 18:37:25 +0000 (20:37 +0200)]
Separate witness type computation from the generator transform.

17 months agoRemember where a type was kept in MIR.
Camille GILLOT [Sun, 11 Sep 2022 15:24:53 +0000 (17:24 +0200)]
Remember where a type was kept in MIR.

17 months agoIntroduce GeneratorWitnessMIR.
Camille GILLOT [Sat, 1 Oct 2022 12:56:24 +0000 (14:56 +0200)]
Introduce GeneratorWitnessMIR.

17 months agoAlways require Drop for generators.
Camille GILLOT [Sun, 11 Sep 2022 15:22:38 +0000 (17:22 +0200)]
Always require Drop for generators.

17 months agoTest the 3 generator handling versions for generator/async tests.
Camille GILLOT [Sat, 1 Oct 2022 10:19:31 +0000 (12:19 +0200)]
Test the 3 generator handling versions for generator/async tests.

17 months agoAdd `drop_tracking_mir` option.
Camille GILLOT [Sat, 1 Oct 2022 09:33:16 +0000 (11:33 +0200)]
Add `drop_tracking_mir` option.

17 months agoSeparate trait selection from ambiguity reporting.
Camille GILLOT [Wed, 28 Sep 2022 16:16:23 +0000 (18:16 +0200)]
Separate trait selection from ambiguity reporting.

17 months agoImpl HashStable/Encodable/Decodable for ObligationCause.
Camille GILLOT [Sun, 11 Sep 2022 12:42:43 +0000 (14:42 +0200)]
Impl HashStable/Encodable/Decodable for ObligationCause.

17 months agoDo not abort compilation when failing to normalize opaque types.
Camille GILLOT [Sun, 11 Sep 2022 09:22:47 +0000 (11:22 +0200)]
Do not abort compilation when failing to normalize opaque types.

17 months agorecover more unbraced const args
León Orell Valerian Liehr [Sun, 22 Jan 2023 11:05:36 +0000 (12:05 +0100)]
recover more unbraced const args

17 months agoUse successor location for dominator check.
Camille GILLOT [Sun, 22 Jan 2023 20:39:44 +0000 (20:39 +0000)]
Use successor location for dominator check.

The assignment is complete only after the statement.
This marks self-assignments `x = x + 1` as non-sSA.

17 months agoDo not merge locals that have their address taken.
Camille GILLOT [Fri, 20 Jan 2023 19:34:46 +0000 (19:34 +0000)]
Do not merge locals that have their address taken.

17 months agoExtract SsaLocals abstraction.
Camille GILLOT [Thu, 19 Jan 2023 22:23:41 +0000 (22:23 +0000)]
Extract SsaLocals abstraction.

17 months agoPacify tidy.
Camille GILLOT [Thu, 19 Jan 2023 16:57:32 +0000 (16:57 +0000)]
Pacify tidy.

17 months agoDiscard raw pointers from SSA locals.
Camille GILLOT [Wed, 18 Jan 2023 22:59:52 +0000 (22:59 +0000)]
Discard raw pointers from SSA locals.

17 months agoOnly consider a local to be SSA if assignment dominates all uses.
Camille GILLOT [Sun, 15 Jan 2023 20:16:28 +0000 (20:16 +0000)]
Only consider a local to be SSA if assignment dominates all uses.

17 months agoAdd tests.
Camille GILLOT [Sun, 15 Jan 2023 15:30:09 +0000 (15:30 +0000)]
Add tests.

17 months agoImplement SSA CopyProp pass.
Camille GILLOT [Thu, 12 Jan 2023 18:23:48 +0000 (18:23 +0000)]
Implement SSA CopyProp pass.

17 months agoAllow to remove unused definitions without renumbering locals.
Camille GILLOT [Wed, 11 Jan 2023 16:30:35 +0000 (16:30 +0000)]
Allow to remove unused definitions without renumbering locals.

17 months agoConsider `CopyForDeref` for DestProp.
Camille GILLOT [Thu, 29 Dec 2022 19:15:00 +0000 (19:15 +0000)]
Consider `CopyForDeref` for DestProp.

17 months agoAdd mir-opt test.
Camille GILLOT [Sun, 4 Dec 2022 18:21:37 +0000 (18:21 +0000)]
Add mir-opt test.

17 months agoMake tests unit.
Camille GILLOT [Sat, 7 Jan 2023 21:10:38 +0000 (21:10 +0000)]
Make tests unit.

17 months agoUse now solver in evaluate_obligation
Michael Goulet [Fri, 27 Jan 2023 17:46:18 +0000 (17:46 +0000)]
Use now solver in evaluate_obligation

17 months agoAuto merge of #107372 - JohnTitor:rollup-zkl2ges, r=JohnTitor
bors [Fri, 27 Jan 2023 17:49:56 +0000 (17:49 +0000)]
Auto merge of #107372 - JohnTitor:rollup-zkl2ges, r=JohnTitor

Rollup of 9 pull requests

Successful merges:

 - #106806 (Replace format flags u32 by enums and bools.)
 - #107194 (Remove dependency on slice_internals feature in rustc_ast)
 - #107234 (Revisit fix_is_ci_llvm_available logic)
 - #107316 (Update snap from `1.0.1` to `1.1.0`)
 - #107321 (solver comments + remove `TyCtxt::evaluate_goal`)
 - #107332 (Fix wording from `rustbuild` to `bootstrap`)
 - #107347 (reduce rightward-drift)
 - #107352 (compiler: Fix E0587 explanation)
 - #107357 (Fix infinite loop in rustdoc get_all_import_attributes function)

Failed merges:

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

17 months agoDon't merge vtables when full debuginfo is enabled.
Michael Woerister [Fri, 27 Jan 2023 15:29:04 +0000 (15:29 +0000)]
Don't merge vtables when full debuginfo is enabled.

17 months agoRollup merge of #107357 - GuillaumeGomez:fix-infinite-loop-in-rustdoc-get_all_import_...
Yuki Okushi [Fri, 27 Jan 2023 15:23:16 +0000 (00:23 +0900)]
Rollup merge of #107357 - GuillaumeGomez:fix-infinite-loop-in-rustdoc-get_all_import_attributes, r=notriddle

Fix infinite loop in rustdoc get_all_import_attributes function

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

We'll also need to backport this fix to beta.

r? `@notriddle`

17 months agoRollup merge of #107352 - sameo:topic/E0587, r=JohnTitor
Yuki Okushi [Fri, 27 Jan 2023 15:23:15 +0000 (00:23 +0900)]
Rollup merge of #107352 - sameo:topic/E0587, r=JohnTitor

compiler: Fix E0587 explanation

We meant to use 8 as the packed argument.

Signed-off-by: Samuel Ortiz <sameo@rivosinc.com>
17 months agoRollup merge of #107347 - tshepang:rightward-drift, r=Nilstrieb
Yuki Okushi [Fri, 27 Jan 2023 15:23:15 +0000 (00:23 +0900)]
Rollup merge of #107347 - tshepang:rightward-drift, r=Nilstrieb

reduce rightward-drift

17 months agoRollup merge of #107332 - chansuke:issue-107230, r=albertlarsan68
Yuki Okushi [Fri, 27 Jan 2023 15:23:14 +0000 (00:23 +0900)]
Rollup merge of #107332 - chansuke:issue-107230, r=albertlarsan68

Fix wording from `rustbuild` to `bootstrap`

Fixes #107230

17 months agoRollup merge of #107321 - lcnr:comment, r=compiler-errors
Yuki Okushi [Fri, 27 Jan 2023 15:23:14 +0000 (00:23 +0900)]
Rollup merge of #107321 - lcnr:comment, r=compiler-errors

solver comments + remove `TyCtxt::evaluate_goal`

from the `RustcContributor::explore` session yesterday.

This also removes `TyCtxt::evaluate_goal` because to canonicalize you have to use an `InferCtxt` anyways at which point we should just always get people to use `evaluate_root_goal`.

r? ``@spastorino``

17 months agoRollup merge of #107316 - ChrisDenton:snap, r=oli-obk
Yuki Okushi [Fri, 27 Jan 2023 15:23:13 +0000 (00:23 +0900)]
Rollup merge of #107316 - ChrisDenton:snap, r=oli-obk

Update snap from `1.0.1` to `1.1.0`

As spotted by `@mejrs,` snap 1.0.1 emits a future compatibility warning. This was fixed in https://github.com/BurntSushi/rust-snappy/pull/39

17 months agoRollup merge of #107234 - Rattenkrieg:bootstrap-fix-is_ci_llvm_available, r=albertlar...
Yuki Okushi [Fri, 27 Jan 2023 15:23:13 +0000 (00:23 +0900)]
Rollup merge of #107234 - Rattenkrieg:bootstrap-fix-is_ci_llvm_available, r=albertlarsan68

Revisit fix_is_ci_llvm_available logic

Fixes #107225
Now `supported_platforms` has a knowledge whether llvm asserts artifacts are available for particular host triple.

``@jyn514`` ``@albertlarsan68`` PTAL

17 months agoRollup merge of #107194 - xfix:remove-slice-internals-dependency-in-rustc-ast, r...
Yuki Okushi [Fri, 27 Jan 2023 15:23:12 +0000 (00:23 +0900)]
Rollup merge of #107194 - xfix:remove-slice-internals-dependency-in-rustc-ast, r=Nilstrieb

Remove dependency on slice_internals feature in rustc_ast

This reduces dependency on unstable features by the compiler.

17 months agoRollup merge of #106806 - m-ou-se:format-args-flags, r=oli-obk
Yuki Okushi [Fri, 27 Jan 2023 15:23:11 +0000 (00:23 +0900)]
Rollup merge of #106806 - m-ou-se:format-args-flags, r=oli-obk

Replace format flags u32 by enums and bools.

This gets rid of the `flags: u32` field where each bit has a special meaning, and replaces it by simple enums and booleans.

Part of #99012

17 months agoAuto merge of #107055 - kylematsuda:eb-fn-sig, r=lcnr
bors [Fri, 27 Jan 2023 15:02:44 +0000 (15:02 +0000)]
Auto merge of #107055 - kylematsuda:eb-fn-sig, r=lcnr

Switch to `EarlyBinder` for `fn_sig` query

Part of the work to finish #105779 (also see https://github.com/rust-lang/types-team/issues/78).

Several queries `X` have a `bound_X` variant that wraps the output in [`EarlyBinder`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/subst/struct.EarlyBinder.html). This adds `EarlyBinder` to the return type of the `fn_sig` query and removes `bound_fn_sig`.

r? `@lcnr`

17 months agoAuto merge of #10237 - cstyles:fix-docs-for-suspicious_xor_used_as_pow, r=Jarcho
bors [Fri, 27 Jan 2023 14:02:23 +0000 (14:02 +0000)]
Auto merge of #10237 - cstyles:fix-docs-for-suspicious_xor_used_as_pow, r=Jarcho

Fix styling in documentation for `suspicious_xor_used_as_pow` lint

There was a tab after the three leading slashes which caused the contents of the "Why is this bad?" section to be rendered as a code block.

**Before:**

<img width="626" alt="master" src="https://user-images.githubusercontent.com/4869194/214985546-4433d211-9fd3-450c-8ff7-2c0a47fccdc0.png">

**After:**

<img width="520" alt="fixed" src="https://user-images.githubusercontent.com/4869194/214985561-87255196-008c-4a1c-8cc8-c54b337d22a2.png">

The file still contains a lot of tabs but they don't affect the documentation.

---

changelog: [`suspicious_xor_used_as_pow`]: Fix styling in documentation

17 months agoRevert back to LlvmArchiveBuilder on all platforms
bjorn3 [Fri, 27 Jan 2023 11:48:36 +0000 (11:48 +0000)]
Revert back to LlvmArchiveBuilder on all platforms

ArArchiveBuilder doesn't support reading thin archives, causing a
regression.

17 months agoRevert "Remove macOS fat archive support from LlvmArchiveBuilder"
bjorn3 [Fri, 27 Jan 2023 11:46:27 +0000 (11:46 +0000)]
Revert "Remove macOS fat archive support from LlvmArchiveBuilder"

This reverts commit 047c7cc60c05e2cf182c6f578581cf2a67b1d0ff.