Commit Graph

222358 Commits

Author SHA1 Message Date
fee1-dead
38215fb77a
Rollup merge of #110402 - scottmcm:align-tz, r=fee1-dead
Remove the loop in `Align::from_bytes`

Perf is almost certainly irrelevant, but might as well simplify it, since `trailing_zeros` does exactly what's needed.
2023-04-16 19:36:03 +08:00
fee1-dead
1d30adb068
Rollup merge of #110400 - matthiaskrgr:style_mix, r=fee1-dead
more clippy fixes: clippy::{iter_cloned_collect, unwarp_or_else_defau…

…lt, option_map_or_none}

r? `@Nilstrieb`
2023-04-16 19:36:02 +08:00
fee1-dead
fba49a7ee2
Rollup merge of #110398 - matthiaskrgr:clippy_match, r=Nilstrieb,fee1-dead
use matches! macro in more places

r? `@Nilstrieb`
2023-04-16 19:36:02 +08:00
fee1-dead
508d661105
Rollup merge of #110397 - Nilstrieb:speedy-bootstrap-2, r=fee1-dead,jyn514
Move some utils out of `rustc_const_eval`

This allows us to get rid of the `rustc_const_eval->rustc_borrowck` dependency edge which was delaying the compilation of borrowck.

The added utils in `rustc_middle` are small and should not affect compile times there.
2023-04-16 19:36:01 +08:00
Matthias Krüger
543f8bc38c fix clippy::toplevel_ref_arg and ::manual_map 2023-04-16 13:28:13 +02:00
klensy
e4a9d137d0 bolt: remove deprecated option value 2023-04-16 14:13:14 +03:00
Scott McMurray
99fd9cb697 Remove the loop in Align::from_bytes
Perf is almost certainly irrelevant, but might as well simplify it, since `trailing_zeros` does exactly what's needed.
2023-04-16 04:01:34 -07:00
bors
1b50ea9abb Auto merge of #110401 - fee1-dead-contrib:rollup-1f2smz2, r=fee1-dead
Rollup of 3 pull requests

Successful merges:

 - #109665 (Remove `remap_env_constness` in queries)
 - #110345 (Remove `TypeSuper{Foldable,Visitable}` impls for `Region`.)
 - #110396 (Use lint via `lint_defs` instead of `lints`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-04-16 10:57:28 +00:00
fee1-dead
7fb14ae84d
Rollup merge of #110396 - Nilstrieb:speedy-bootstrap, r=jyn514
Use lint via `lint_defs` instead of `lints`

This gets rid of a blocking dependency edge from `rustc_lint->rustc_analysis->rustc_hir_typeck->rustc_interface`

![image](https://user-images.githubusercontent.com/48135649/232291152-fc61e6c5-9b1e-4db1-8101-dfaa3b7d30c6.png)
2023-04-16 18:55:39 +08:00
fee1-dead
eba419195c
Rollup merge of #110345 - nnethercote:rm-Super-impls-for-Region, r=compiler-errors
Remove `TypeSuper{Foldable,Visitable}` impls for `Region`.

These traits exist so that folders/visitors can recurse into types of interest: binders, types, regions, predicates, and consts. But `Region` is non-recursive and cannot contain other types of interest, so its methods in these traits are trivial.

This commit inlines and removes those trivial methods.

r? `@compiler-errors`
2023-04-16 18:55:38 +08:00
fee1-dead
a5136f14ae
Rollup merge of #109665 - fee1-dead-contrib:rm-remap-queries, r=oli-obk
Remove `remap_env_constness` in queries

This removes some of the complexities with const traits. #88119 used to be caused by this but was fixed by `param_env = param_env.without_const()`.
2023-04-16 18:55:38 +08:00
Erik Hofmayer
bfa87984d2 Fix error due to renaming of ignore_git 2023-04-16 12:50:33 +02:00
Erik Hofmayer
550df4d34b Change mode of Makefile of test for issue 107094 2023-04-16 12:50:32 +02:00
Erik Hofmayer
135e6201fc Add regression test for issue 107094 2023-04-16 12:50:32 +02:00
Erik Hofmayer
d535af3625 Add needs-git-hash header to compiletest
This header can be used for tests which check the output of `--version --verbose` commands.
2023-04-16 12:50:32 +02:00
Matthias Krüger
6ef8648a48 more clippy fixes: clippy::{iter_cloned_collect, unwarp_or_else_default, option_map_or_none} 2023-04-16 12:45:51 +02:00
Erik Hofmayer
28d27fd164 Set git info env variables when building tools
This should fix issue #107094.
2023-04-16 12:09:00 +02:00
Matthias Krüger
bcc15bba95 use matches! macro in more places 2023-04-16 12:08:30 +02:00
Nilstrieb
2109fe4e4e Move some utils out of rustc_const_eval
This allows us to get rid of the `rustc_const_eval->rustc_borrowck`
dependency edge which was delaying the compilation of borrowck.

The added utils in `rustc_middle` are small and should not affect
compile times there.
2023-04-16 12:05:54 +02:00
Camille GILLOT
8889c6fa0e Account for variance in outlives obligations. 2023-04-16 10:01:15 +00:00
Camille GILLOT
4e7edf3684 Add tests. 2023-04-16 09:58:08 +00:00
Nilstrieb
ee8f92ba0a Use lints via lint_defs instead of lints
This gets rid of a blocking dependency edge from
`rustc_lint->rustc_analysis->rustc_hir_typeck->rustc_interface`
2023-04-16 11:48:01 +02:00
Scott McMurray
c98895d9f2 Various minor Idx-related tweaks
Nothing particularly exciting here, but a couple of things I noticed as I was looking for more index conversions to simplify.
2023-04-16 02:42:50 -07:00
Deadbeef
147e850691 revive raw pointer comp error 2023-04-16 09:25:48 +00:00
Deadbeef
eac922e721 readd const_trait to Drop, Destruct, and Fn* 2023-04-16 09:25:23 +00:00
bors
18109d5032 Auto merge of #110391 - est31:remove_allow_unused, r=fee1-dead
Remove unused unused_macros

The macro is always used
2023-04-16 08:39:32 +00:00
Deadbeef
34097b2f33 fix tidy 2023-04-16 07:27:28 +00:00
Deadbeef
ede7bc032a make rustc compilable 2023-04-16 07:25:13 +00:00
Deadbeef
4ecbd3be52 fix alloc 2023-04-16 07:21:33 +00:00
Deadbeef
63e0ddbf1d core is now compilable 2023-04-16 07:20:26 +00:00
Deadbeef
e80c020445 more hacks 2023-04-16 07:20:15 +00:00
Deadbeef
ddc02b0f32 hack cstr is_empty 2023-04-16 07:05:54 +00:00
Deadbeef
d88f979437 hack signum as well 2023-04-16 07:04:17 +00:00
Deadbeef
8cda8df578 memchr hack 2023-04-16 07:00:52 +00:00
Deadbeef
76dbe29104 rm const traits in libcore 2023-04-16 06:49:27 +00:00
est31
77821b2eb9 Remove unused unused_macros
The macro is always used
2023-04-16 08:35:39 +02:00
Deadbeef
dda89945b7 Allow all associated functions and add test 2023-04-16 06:31:08 +00:00
bors
e6e956dade Auto merge of #110390 - fee1-dead-contrib:rollup-kh2ov9r, r=fee1-dead
Rollup of 3 pull requests

Successful merges:

 - #110376 (Convert comment to doc comment on `Interner::get`.)
 - #110379 (Update some ignored tests.)
 - #110387 (Don't `use rustc_hir as ast`(!))

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-04-16 06:25:14 +00:00
fee1-dead
312cad1f74
Rollup merge of #110387 - nnethercote:rm-use-rustc_hir-as-ast, r=fee1-dead
Don't `use rustc_hir as ast`(!)

It makes for confusing code.

This was introduced in a large commit in #67886 that rearranged a lot of `use` statements. I suspect it was an accident.
2023-04-16 14:24:33 +08:00
fee1-dead
4d868c9508
Rollup merge of #110379 - ehuss:unignore-tests, r=compiler-errors
Update some ignored tests.

This unignores some tests which no longer need to be ignored (see individual commits for reasons why). This also adds some descriptions to why tests are ignored so they can be seen in the test output.
2023-04-16 14:24:33 +08:00
fee1-dead
ff39942d33
Rollup merge of #110376 - aDotInTheVoid:doc-comment, r=jyn514
Convert comment to doc comment on `Interner::get`.
2023-04-16 14:24:32 +08:00
John Bobbo
d0603fdafa
Use a saturating_mul instead of a checked_mul
and `unwrap` in `core::intrinsics`.
2023-04-15 22:40:26 -07:00
Nicholas Nethercote
1ffa331c72 Don't use rustc_hir as ast(!)
It makes for confusing code.

This was introduced in a large commit in #67886 that rearranged a lot of
`use` statements. I suspect it was an accident.
2023-04-16 15:03:17 +10:00
Nicholas Nethercote
d2b5a64579 Simplify CloneLiftImpls and TrivialTypeTraversalImpls.
They both allow for a lifetime other than `'tcx`, but this isn't needed.
2023-04-16 14:19:50 +10:00
Nicholas Nethercote
32f6e7a38e Remove EnumTypeTraversalImpl.
I suspect this macro was around before `TypeFoldable`/`TypeVisitable`
were derivable. But now it's only used for two types, `Result` and
`Option`. Removing the macro and implementing the traits for those types
by hand makes the code much simpler.
2023-04-16 13:49:12 +10:00
bors
2a71115261 Auto merge of #105888 - skyzh:skyzh/suggest-lifetime-closure, r=compiler-errors
suggest lifetime for closure parameter type when mismatch

This is a draft PR, will add test cases later and be ready for review.

This PR fixes https://github.com/rust-lang/rust/issues/105675 by adding a diagnostics suggestion. Also a partial fix to https://github.com/rust-lang/rust/issues/105528.

The following code will have a compile error now:

```
fn const_if_unit(input: bool) -> impl for<'a> FnOnce(&'a ()) -> usize {
    let x = |_| 1;
    x
}
```

Before this PR:

```
error[E0308]: mismatched types
 --> src/lib.rs:3:5
  |
3 |     x
  |     ^ one type is more general than the other
  |
  = note: expected trait `for<'a> FnOnce<(&'a (),)>`
             found trait `FnOnce<(&(),)>`
note: this closure does not fulfill the lifetime requirements
 --> src/lib.rs:2:13
  |
2 |     let x = |_| 1;
  |             ^^^

error: implementation of `FnOnce` is not general enough
 --> src/lib.rs:3:5
  |
3 |     x
  |     ^ implementation of `FnOnce` is not general enough
  |
  = note: closure with signature `fn(&'2 ()) -> usize` must implement `FnOnce<(&'1 (),)>`, for any lifetime `'1`...
  = note: ...but it actually implements `FnOnce<(&'2 (),)>`, for some specific lifetime `'2`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `rust-test` due to 2 previous errors
```

After this PR:

```
error[E0308]: mismatched types
 --> src/lib.rs:3:5
  |
3 |     x
  |     ^ one type is more general than the other
  |
  = note: expected trait `for<'a> FnOnce<(&'a (),)>`
             found trait `FnOnce<(&(),)>`
note: this closure does not fulfill the lifetime requirements
 --> src/lib.rs:2:13
  |
2 |     let x = |_| 1;
  |             ^^^
help: consider changing the type of the closure parameters
  |
2 |     let x = |_: &_| 1;
  |             ~~~~~~~

error: implementation of `FnOnce` is not general enough
 --> src/lib.rs:3:5
  |
3 |     x
  |     ^ implementation of `FnOnce` is not general enough
  |
  = note: closure with signature `fn(&'2 ()) -> usize` must implement `FnOnce<(&'1 (),)>`, for any lifetime `'1`...
  = note: ...but it actually implements `FnOnce<(&'2 (),)>`, for some specific lifetime `'2`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `rust-test` due to 2 previous errors
```

After applying the suggestion, it compiles. The suggestion might not always be correct as the generation procedure of that suggestion is quite simple...
2023-04-16 03:06:46 +00:00
bors
c6fb7b9815 Auto merge of #110375 - JohnTitor:rollup-ghvdaxm, r=JohnTitor
Rollup of 8 pull requests

Successful merges:

 - #110033 (Add 1.69.0 release notes)
 - #110272 (fix: skip implied bounds if unconstrained lifetime exists)
 - #110307 (Allow everyone to set the beta-nominated label)
 - #110347 (Add intra-doc links to size_of_* functions)
 - #110350 (Add a UI test for #79605)
 - #110356 (Fix `x test rust-installer` when `cargo` is set to a relative path)
 - #110364 (remove redundant clones)
 - #110366 (fix some clippy::complexity)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-04-16 00:07:06 +00:00
Nicholas Nethercote
4460a1dc28 Remove TypeSuper{Foldable,Visitable} impls for Region.
These traits exist so that folders/visitors can recurse into types of
interest: binders, types, regions, predicates, and consts. But `Region`
is non-recursive and cannot contain other types of interest, so its
methods in these traits are trivial.

This commit inlines and removes those trivial methods.
2023-04-16 09:11:43 +10:00
Eric Huss
a4e851cf62 Add some reasons why tests are ignored. 2023-04-15 16:11:42 -07:00
Eric Huss
3a645659b8 Unignore issue-65918
This test was fixed by https://github.com/rust-lang/rust/pull/65989
2023-04-15 15:23:32 -07:00