summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2023-02-02Revert back to LlvmArchiveBuilder on all platformsbjorn3-1/+3
ArArchiveBuilder doesn't support reading thin archives, causing a regression.
2023-01-21Revert "Make PROC_MACRO_DERIVE_RESOLUTION_FALLBACK a hard error"Mark Rousskov-13/+138
This reverts commit 7d82cadd97acc66993b69304c5a1a04ef7d1fa36.
2023-01-21Conditionally encode booleanMichael Goulet-4/+15
2023-01-21Encode whether foreign opaques are TAITs or notMichael Goulet-2/+23
2023-01-19Correct detection of elided lifetimes in impl-trait.Camille GILLOT-2/+4
2023-01-19Do not filter substs in `remap_generic_params_to_declaration_params`.Camille GILLOT-28/+2
The relevant filtering should have been performed by borrowck.
2023-01-19Revert "Make nested RPITIT inherit the parent opaque's generics." and adjust ↵Michael Goulet-1/+15
test This reverts commit e2d41f4c974f0cc09e5aafb02883f222487610f9.
2022-12-28Auto merge of #106163 - compiler-errors:🅱-IMPLIED_BOUNDS_ENTAILMENT, ↵bors-14/+147
r=Mark-Simulacrum Backport `IMPLIED_BOUNDS_ENTAILMENT` lint r? `@Mark-Simulacrum` as requested https://github.com/rust-lang/rust/pull/105575#issuecomment-1365490589
2022-12-27Switch `#[track_caller]` back to a no-op unless feature gate is enabledBryan Garza-11/+83
This patch fixes a regression, in which `#[track_caller]`, which was previously a no-op, was changed to actually turn on the behavior. This should instead only happen behind the `closure_track_caller` feature gate. Also, add a warning for the user to understand how their code will compile depending on the feature gate being turned on or not. Fixes #104588
2022-12-26Make fast-path for implied wf lint betterMichael Goulet-71/+92
2022-12-26Downgrade IMPLIED_BOUNDS_ENTAILMENT to warn by default, add it to builtin ↵Michael Goulet-4/+5
lint list
2022-12-26Add IMPLIED_BOUNDS_ENTAILMENT lintMichael Goulet-7/+118
2022-12-26Mangle "main" as "__main_void" on wasm32-wasiDan Gohman-0/+4
On wasm, the age-old C trick of having a main function which can either have no arguments or argc+argv doesn't work, because wasm requires caller and callee signatures to match. WASI's current strategy is to have compilers mangle main's name to indicate which signature they're using. Rust uses the no-argument form, which should be mangled as `__main_void`. This is needed on wasm32-wasi as of #105395.
2022-12-26don't copy symbols from dylibs with -Zdylib-ltoRémy Rakic-1/+1
2022-12-26Revert "Replace usage of `ResumeTy` in async lowering with `Context`"Andrew Pollack-38/+25
2022-12-12update stabilization version numbersPietro Albini-4/+4
2022-12-09Auto merge of #104572 - pkubaj:patch-1, r=cuviperbors-6/+8
Fix build on powerpc-unknown-freebsd Probably also fixes build on arm and mips*. Related to https://github.com/rust-lang/rust/issues/104220
2022-12-09Auto merge of #105486 - matthiaskrgr:rollup-o7c4l1c, r=matthiaskrgrbors-1096/+1769
Rollup of 10 pull requests Successful merges: - #105216 (Remove unused GUI test) - #105245 (attempt to clarify align_to docs) - #105387 (Improve Rustdoc scrape-examples UI) - #105389 (Enable profiler in dist-powerpc64le-linux) - #105427 (Dont silently ignore rustdoc errors) - #105442 (rustdoc: clean up docblock table CSS) - #105443 (Move some queries and methods) - #105455 (use the correct `Reveal` during validation) - #105470 (Clippy: backport ICE fix before beta branch) - #105474 (lib docs: fix typo) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-09Rollup merge of #105455 - lcnr:correct-reveal-in-validate, r=jackh726Matthias Krüger-1/+13
use the correct `Reveal` during validation supersedes #105454. Deals with https://github.com/rust-lang/rust/issues/105009#issuecomment-1342395333, not closing #105009 as the ICE may leak into beta The issue was the following: - we optimize the mir, using `Reveal::All` - some optimization relies on the hidden type of an opaque type - we then validate using `Reveal::UserFacing` again which is not able to observe the hidden type r? `@jackh726`
2022-12-09Rollup merge of #105443 - compiler-errors:move-more, r=oli-obkMatthias Krüger-1095/+1756
Move some queries and methods Each commit's title should be self-explanatory. Motivated to break up some large, general files and move queries into leaf crates.
2022-12-09Auto merge of #104449 - oli-obk:unhide_unknown_spans, r=estebank,RalfJungbors-77/+87
Start emitting labels even if their pointed to file is not available locally r? `@estebank` cc `@RalfJung` fixes #97699
2022-12-09Fix build on powerpc-unknown-freebsdpkubaj-6/+8
Probably also fixes build on mips*. Related to https://github.com/rust-lang/rust/issues/104220
2022-12-08Rollup merge of #105441 - nnethercote:rm-UnsafetyState, r=lcnrMatthias Krüger-42/+3
Remove `UnsafetyState` r? `@lcnr`
2022-12-08Rollup merge of #105423 - oli-obk:symbols, r=jackh726Matthias Krüger-91/+102
Use `Symbol` for the crate name instead of `String`/`str` It always got converted to a symbol anyway
2022-12-08Rollup merge of #105408 - cuviper:help-rpitirpit, r=compiler-errorsMatthias Krüger-17/+34
Add help for `#![feature(impl_trait_in_fn_trait_return)]` This adds a new variant `ImplTraitContext::FeatureGated`, so we can generalize the help for `return_position_impl_trait_in_trait` to also work for `impl_trait_in_fn_trait_return`. cc #99697
2022-12-08Rollup merge of #105405 - sunfishcode:sunfishcode/export-dynamic, r=TaKO8KiMatthias Krüger-7/+0
Stop passing -export-dynamic to wasm-ld. -export-dynamic was a temporary hack added in the early days of the Rust wasm32 target when Rust didn't have a way to specify wasm exports in the source code. This flag causes all global symbols, and some compiler-internal symbols, to be exported, which is often more than needed. Rust now does have a way to specify exports in the source code: `#[export_name = "..."]`. So as the original comment suggests, -export-dynamic can now be removed, allowing users to have smaller binaries and better encapsulation in their wasm32-unknown-unknown modules. It's possible that this change will require existing wasm32-unknown-unknown users will to add explicit `#[export_name = "..."]` directives to exporrt the symbols that their programs depend on having exported.
2022-12-08Rollup merge of #105317 - RalfJung:retag-rework, r=oli-obkMatthias Krüger-67/+63
make retagging work even with 'unstable' places This is based on top of https://github.com/rust-lang/rust/pull/105301. Only the last two commits are new. While investigating https://github.com/rust-lang/unsafe-code-guidelines/issues/381 I realized that we would have caught this issue much earlier if the add_retag pass wouldn't bail out on assignments of the form `*ptr = ...`. So this PR changes our retag strategy: - When a new reference is created via `Rvalue::Ref` (or a raw ptr via `Rvalue::AddressOf`), we do the retagging as part of just executing that address-taking operation. - For everything else, we still insert retags -- these retags basically serve to ensure that references stored in local variables (and their fields) are always freshly tagged, so skipping this for assignments like `*ptr = ...` is less egregious. r? ```@oli-obk```
2022-12-08Rollup merge of #105255 - cjgillot:issue-105197, r=compiler-errorsMatthias Krüger-15/+1
Make nested RPIT inherit the parent opaque's generics. Fixes https://github.com/rust-lang/rust/issues/105197 r? ```@compiler-errors```
2022-12-08Rollup merge of #104922 - estebank:fur-elize, r=oli-obkMatthias Krüger-90/+136
Detect long types in E0308 and write them to disk On type error with long types, print an abridged type and write the full type to disk. Print the widest possible short type while still fitting in the terminal.
2022-12-08validate: use the correct reveal during optslcnr-1/+13
2022-12-08Move some suggestions from error_reporting to error_reporting::suggestMichael Goulet-661/+1305
2022-12-08Move codegen_select_candidate to a rustc_traitsMichael Goulet-8/+8
2022-12-08Move vtable methods into its own moduleMichael Goulet-378/+398
2022-12-08Move has_structural_eq_impls provider to rustc_ty_utilsMichael Goulet-49/+46
2022-12-08Fix a typo.Nicholas Nethercote-1/+1
2022-12-08Remove `UnsafetyState`.Nicholas Nethercote-41/+2
`FnCtxt::ps` is the only occurrence. It gets updated during HIR typechecking, but is never looked at.
2022-12-07Use `Symbol` for the crate name instead of `String`/`str`Oli Scherer-91/+102
2022-12-07Rollup merge of #105418 - BelovDV:fix-libc-hack, r=petrochenkovMatthias Krüger-9/+0
fix: remove hack from link.rs This logic implemented in libc. r? `@petrochenkov`
2022-12-07Rollup merge of #105400 - BoxyUwU:braced_param_evaluatability, r=oli-obkMatthias Krüger-1/+1
normalize before handling simple checks for evaluatability of `ty::Const` `{{{{{{{ N }}}}}}}` is desugared into a `ConstKind::Unevaluated` for an anonymous `const` item so when calling `is_const_evaluatable` on it we skip the `ConstKind::Param(_) => Ok(())` arm which is incorrect.
2022-12-07Rollup merge of #105368 - WaffleLapkin:deref-even-harder, r=TaKO8KiMatthias Krüger-421/+390
Remove more `ref` patterns from the compiler Previous PR: #105045
2022-12-07Rollup merge of #105343 - nbdd0121:hir, r=fee1-deadMatthias Krüger-106/+45
Simplify attribute handling in rustc_ast_lowering Given that attributes is stored in a separate BTreeMap, it's not necessary to pass it in when constructing `hir::Expr`. We can just construct `hir::Expr` and then call `self.lower_attrs` later if it needs attributes. As most desugaring code don't use attributes, this allows some code cleanup.
2022-12-07Rollup merge of #105267 - compiler-errors:issue-104613, r=oli-obkMatthias Krüger-19/+31
Don't ICE in ExprUseVisitor on FRU for non-existent struct Fixes #104613 Fixes #105202
2022-12-07Auto merge of #104799 - pcc:linkage-fn, r=tmiaskobors-58/+106
Support Option and similar enums as type of static variable with linkage attribute Compiler MCP: rust-lang/compiler-team#565
2022-12-07fix: remove hack from link.rs (moved to libc)Daniil Belov-9/+0
2022-12-07Auto merge of #105291 - nnethercote:remove-LintPassObjects, r=cjgillotbors-100/+51
Remove `{Early,Late}LintPassObjects`. `EarlyContextAndPass` wraps a single early lint pass. We aggregate multiple passes into that single pass by using `EarlyLintPassObjects`. This commit removes `EarlyLintPassObjects` by changing `EarlyContextAndPass` into `EarlyContextAndPasses`. I.e. it just removes a level of indirection. This makes the code simpler and slightly faster. The commit does likewise for late lints. r? `@cjgillot`
2022-12-06Add help for `#![feature(impl_trait_in_fn_trait_return)]`Josh Stone-17/+34
This adds a new variant `ImplTraitContext::FeatureGated`, so we can generalize the help for `return_position_impl_trait_in_trait` to also work for `impl_trait_in_fn_trait_return`.
2022-12-06Stop passing -export-dynamic to wasm-ld.Dan Gohman-7/+0
-export-dynamic was a temporary hack added in the early days of the Rust wasm32 target when Rust didn't have a way to specify wasm exports in the source code. This flag causes all global symbols, and some compiler-internal symbols, to be exported, which is often more than needed. Rust now does have a way to specify exports in the source code: `#[export_name = "..."]`. So as the original comment suggests, -export-dynamic can now be removed, allowing users to have smaller binaries and better encapsulation in their wasm32-unknown-unknown modules. It's possible that this change will require existing wasm32-unknown-unknown users will to add explicit `#[export_name = "..."]` directives to exporrt the symbols that their programs depend on having exported.
2022-12-06normalize before matching on `ConstKind`Boxy-1/+1
2022-12-06Rollup merge of #105382 - BoxyUwU:fixme_typo_sadface, r=lcnrMatthias Krüger-1/+1
remove an excess `this`
2022-12-06Rollup merge of #105298 - krasimirgg:llvm-16-dec-1, r=cuviperMatthias Krüger-1/+26
llvm-wrapper: adapt for an LLVM API change Adapts llvm-wrapper for https://github.com/llvm/llvm-project/commit/8c7c20f033c7036a8bf231ca6f9e02172cb581f0. No functional changes intended. Found via our experimental rust + llvm @ HEAD bot: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/15404#0184d95d-5a68-4db6-ad32-51ddbc3ab543/202-571