Matthias Krüger
b1e680650e
Rollup merge of #105200 - cjgillot:issue-104562, r=compiler-errors
...
Remove useless filter in unused extern crate check.
Fixes https://github.com/rust-lang/rust/issues/104562
2022-12-03 17:37:44 +01:00
Matthias Krüger
ed9a21eb0c
Rollup merge of #105193 - tmiasko:naked-nocoverage, r=wesleywiser
...
Disable coverage instrumentation for naked functions
Fixes #105170 .
2022-12-03 17:37:44 +01:00
Camille GILLOT
59cc6cd4ac
Remove useless filter in unused extern crate check.
2022-12-03 09:23:03 +00:00
Tomasz Miąsko
b740cdcf43
Mark naked functions as never inline in codegen_fn_attrs
...
Use code generation attributes to ensure that naked functions are never
inline, replacing separate checks in MIR inliner and LLVM code
generation.
2022-12-03 01:04:42 +01:00
Tomasz Miąsko
c955add18c
Disable coverage instrumentation for naked functions
2022-12-03 01:03:28 +01:00
Matthias Krüger
09e2d0f289
Rollup merge of #105163 - compiler-errors:afit-lt-arity, r=jackh726
...
Check lifetime param count in `collect_trait_impl_trait_tys`
We checked the type and const generics count, but not the lifetimes, which were handled in a different function.
Fixes #105154
2022-12-02 21:22:50 +01:00
Michael Goulet
bd7ee07d02
Check lifetime param count in collect_trait_impl_trait_tys
2022-12-02 04:05:39 +00:00
Vadim Petrochenkov
6cd4dd3091
rustc_hir: Relax lifetime requirements on Visitor::visit_path
2022-12-01 17:04:02 +03:00
bors
24606deaf4
Auto merge of #104905 - compiler-errors:normalization-changes, r=spastorino
...
Some initial normalization method changes
1. Rename `AtExt::normalize` to `QueryNormalizeExt::query_normalize` (using the `QueryNormalizer`)
2. Introduce `NormalizeExt::normalize` to replace `partially_normalize_associated_types_in` (using the `AssocTypeNormalizer`)
3. Rename `FnCtxt::normalize_associated_types_in` to `FnCtxt::normalize`
4. Remove some unused other normalization fns in `Inherited` and `FnCtxt`
Also includes one drive-by where we're no longer creating a `FnCtxt` inside of `check_fn`, but passing it in. This means we don't need such weird `FnCtxt` construction logic.
Stacked on top of #104835 for convenience.
r? types
2022-11-30 11:13:09 +00:00
Santiago Pastorino
537488efd6
Make inferred_outlives_crate return Clause
2022-11-29 12:01:58 -03:00
Michael Goulet
1e236acd05
Make ObligationCtxt::normalize take cause by borrow
2022-11-28 17:35:40 +00:00
Michael Goulet
06786227fd
Simplify more FnCtxt normalization
2022-11-28 17:35:39 +00:00
Michael Goulet
52cd342696
FnCtxt normalization stuff
2022-11-28 17:35:39 +00:00
Nicholas Nethercote
a60e337c88
Rename NestedMetaItem::[Ll]iteral
as NestedMetaItem::[Ll]it
.
...
We already use a mix of `Literal` and `Lit`. The latter is better
because it is shorter without causing any ambiguity.
2022-11-28 15:18:53 +11:00
Nicholas Nethercote
e4a9150872
Rename ast::Lit
as ast::MetaItemLit
.
2022-11-28 15:18:49 +11:00
Matthias Krüger
86304f5149
Rollup merge of #104976 - WaffleLapkin:move_comments, r=cjgillot
...
Prefer doc comments over `//`-comments in compiler
Doc comments are generally nicer: they show up in the documentation, they are shown in IDEs when you hover other mentions of items, etc. Thus it makes sense to use them instead of `//`-comments.
2022-11-27 22:14:08 +01:00
bors
454784afba
Auto merge of #104048 - cjgillot:split-lifetime, r=compiler-errors
...
Separate lifetime ident from lifetime resolution in HIR
Drive-by: change how suggested generic args are computed.
Fixes https://github.com/rust-lang/rust/issues/103815
I recommend reviewing commit-by-commit.
2022-11-27 14:30:19 +00:00
Maybe Waffle
1d42936b18
Prefer doc comments over //
-comments in compiler
2022-11-27 11:19:04 +00:00
Guillaume Gomez
a2e485c25c
Rollup merge of #104786 - WaffleLapkin:amp-mut-help, r=compiler-errors
...
Use the power of adding helper function to simplify code w/ `Mutability`
r? `@compiler-errors`
2022-11-26 17:47:23 +01:00
Santiago Pastorino
974e2837bb
Introduce PredicateKind::Clause
2022-11-25 00:04:54 -03:00
Oli Scherer
42cc8e8f4e
Simplify a bunch of trait ref obligation creations
2022-11-25 00:04:54 -03:00
Camille GILLOT
1c737d6997
Use kw::Empty for elided lifetimes in path.
2022-11-24 17:48:59 +00:00
Camille GILLOT
41090346d8
Change how suggested lifetime args are computed.
2022-11-24 17:48:42 +00:00
hkalbasi
390a637e29
move things from rustc_target::abi to rustc_abi
2022-11-24 16:26:13 +03:30
hkalbasi
27fb904d68
move some layout logic to rustc_target::abi::layout
2022-11-24 16:26:12 +03:30
Matthias Krüger
2190b163a3
Rollup merge of #104775 - spastorino:use-obligation-ctxt-normalize, r=lcnr
...
Use ObligationCtxt::normalize
r? ```@lcnr```
2022-11-24 08:42:37 +01:00
bors
872631d0f0
Auto merge of #104507 - WaffleLapkin:asderefsyou, r=wesleywiser
...
Use `as_deref` in compiler (but only where it makes sense)
This simplifies some code :3
(there are some changes that are not exacly `as_deref`, but more like "clever `Option`/`Result` method use")
2022-11-24 00:17:35 +00:00
Maybe Waffle
da40965300
Add Mutability::{is_mut,is_not}
2022-11-23 20:26:31 +00:00
Maybe Waffle
9b9c7d0ecc
Depend on Mutability
ordering
2022-11-23 20:26:31 +00:00
Camille GILLOT
fb7d25e978
Separate lifetime ident from resolution in HIR.
2022-11-23 19:33:06 +00:00
Santiago Pastorino
409203a315
Use ObligationCtxt::normalize
2022-11-23 11:32:49 -03:00
Manish Goregaokar
53eab246db
Rollup merge of #103488 - oli-obk:impl_trait_for_tait, r=lcnr
...
Allow opaque types in trait impl headers and rely on coherence to reject unsound cases
r? ````@lcnr````
fixes #99840
2022-11-22 22:54:38 -05:00
Yuki Okushi
3ec1ca0516
Rollup merge of #104728 - WaffleLapkin:require-lang-items-politely, r=compiler-errors
...
Use `tcx.require_lang_item` instead of unwrapping lang items
I clearly remember esteban telling me that there is `require_lang_item` but he was from a phone atm and I couldn't find it, so I didn't use it. Stumbled on it today, so here we are :)
2022-11-23 06:40:24 +09:00
Maybe Waffle
b80356a5ab
Use tcx.require_lang_item
instead of unwrapping
2022-11-22 17:19:19 +00:00
bors
66ccf36f16
Auto merge of #104711 - Dylan-DPC:rollup-gkw1qr8, r=Dylan-DPC
...
Rollup of 6 pull requests
Successful merges:
- #104295 (Check generics parity before collecting return-position `impl Trait`s in trait)
- #104464 (Reduce exceptions overallocation on non Windows x86_64)
- #104615 (Create def_id for async fns during lowering)
- #104669 (Only declare bindings for if-let guards once per arm)
- #104701 (Remove a lifetime resolution hack from `compare_predicate_entailment`)
- #104710 (disable strict-provenance-violating doctests in Miri)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
2022-11-22 13:18:45 +00:00
Dylan DPC
b12d31f166
Rollup merge of #104701 - compiler-errors:rpitit-remove-reempty-hack, r=TaKO8Ki
...
Remove a lifetime resolution hack from `compare_predicate_entailment`
This is not needed anymore, probably due to #102334 equating the function signatures fully in `collect_trait_impl_trait_tys`. Also, the assertion in in #102903 makes sure that this is actually fixed, so I'm pretty confident this isn't needed.
2022-11-22 16:36:38 +05:30
bors
b7463e8bdb
Auto merge of #103578 - petrochenkov:nofict, r=nagisa
...
Unreserve braced enum variants in value namespace
With this PR braced enum variants (`enum E { V { /*...*/ } }`) no longer take a slot in value namespace, so the special case mentioned in the note in https://github.com/rust-lang/rfcs/blob/master/text/1506-adt-kinds.md#braced-structs is removed.
Report - https://github.com/rust-lang/rust/pull/103578#issuecomment-1292594900 .
2022-11-22 10:17:09 +00:00
Michael Goulet
1c1778da25
Remove a hack from compare_predicate_entailment
2022-11-22 03:41:13 +00:00
Michael Goulet
df5f247a5c
Delay bug to deduplicate diagnostics
2022-11-22 01:36:41 +00:00
Michael Goulet
0a95878972
drive-by: style nits
2022-11-22 01:36:41 +00:00
Michael Goulet
94e047ba3b
Check generics parity between impl and trait before collecting RPITITs
2022-11-22 01:36:41 +00:00
Oli Scherer
7658e0fccf
Stop passing the self-type as a separate argument.
2022-11-21 20:39:46 +00:00
Oli Scherer
ad57f88d3f
Add helper to create the trait ref for a lang item
2022-11-21 20:35:17 +00:00
Oli Scherer
9e4c3f41c1
Use iterators instead of slices at more sites
2022-11-21 20:34:28 +00:00
Oli Scherer
ec8d01fdcc
Allow iterators instead of requiring slices that will get turned into iterators
2022-11-21 20:33:55 +00:00
Oli Scherer
6f77c97b38
Assert that various types have the right amount of generic args and fix the sites that used the wrong amount
2022-11-21 20:31:59 +00:00
Vadim Petrochenkov
7a5376d23c
Unreserve braced enum variants in value namespace
2022-11-21 22:40:06 +03:00
Oli Scherer
ae80c764d4
Add an always-ambiguous predicate to make sure that we don't accidentlally allow trait resolution to prove false things during coherence
2022-11-21 16:35:04 +00:00
Oli Scherer
94fe30ff2f
Treat different opaque types of the same def id as equal during coherence
2022-11-21 16:06:07 +00:00
Oli Scherer
2752e328c9
Allow opaque types in trait impl headers and rely on coherence to reject unsound cases
2022-11-21 16:00:31 +00:00