about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-12-07Add explanations to scrape-examples integration testWill Crichton-0/+6
2022-12-07Improve several aspects of the Rustdoc scrape-examples UI.Will Crichton-0/+34
* Examples take up less screen height. * Snippets from binary crates are prioritized. * toggle-all-docs does not expand "More examples" sections.
2022-12-07Don't internalize __llvm_profile_counter_biasAlex Brachet-0/+10
Currently, LLVM profiling runtime counter relocation cannot be used by rust during LTO because symbols are being internalized before all symbol information is known. This mode makes LLVM emit a __llvm_profile_counter_bias symbol which is referenced by the profiling initialization, which itself is pulled in by the rust driver here [1]. It is enabled with -Cllvm-args=-runtime-counter-relocation for platforms which are opt-in to this mode like Linux. On these platforms there will be no link error, rather just surprising behavior for a user which request runtime counter relocation. The profiling runtime will not see that symbol go on as if it were never there. On Fuchsia, the profiling runtime must have this symbol which will cause a hard link error. As an aside, I don't have enough context as to why rust's LTO model is how it is. AFAICT, the internalize pass is only safe to run at link time when all symbol information is actually known, this being an example as to why. I think special casing this symbol as a known one that LLVM can emit which should not have it's visbility de-escalated should be fine given how seldom this pattern of defining an undefined symbol to get initilization code pulled in is. From a quick grep, __llvm_profile_runtime is the only symbol that rustc does this for. [1] https://github.com/rust-lang/rust/blob/0265a3e93bf1b89d97cae113ed214954d5c35e22/compiler/rustc_codegen_ssa/src/back/linker.rs#L598
2022-12-07Rollup merge of #105400 - BoxyUwU:braced_param_evaluatability, r=oli-obkMatthias Krüger-0/+12
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 #105267 - compiler-errors:issue-104613, r=oli-obkMatthias Krüger-0/+54
Don't ICE in ExprUseVisitor on FRU for non-existent struct Fixes #104613 Fixes #105202
2022-12-07Add tests for #41731Steven Tang-0/+106
Closes #41731
2022-12-07Make -Zsimulate-remapped-rust-src-base reproducible on CIOli Scherer-9/+9
2022-12-07Auto merge of #104799 - pcc:linkage-fn, r=tmiaskobors-30/+15
Support Option and similar enums as type of static variable with linkage attribute Compiler MCP: rust-lang/compiler-team#565
2022-12-07Avoid remapping paths back to `$SRC_DIR` in CIOli Scherer-6/+6
2022-12-07fix #105226, Detect spurious ; before assoc fn bodyyukang-0/+53
2022-12-07consider `parent_count` for const param defaultsTakayuki Maeda-0/+16
2022-12-07Compute generator sizes with -Zprint_type_sizesMichael Goulet-0/+66
2022-12-06Add help for `#![feature(impl_trait_in_fn_trait_return)]`Josh Stone-0/+6
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-06normalize before matching on `ConstKind`Boxy-0/+12
2022-12-06Rollup merge of #105358 - TaKO8Ki:fix-104260, r=estebankMatthias Krüger-0/+14
Add a test for #104260 Fixes #104260
2022-12-06Filter out precise alloc ids from diagnosticsOli Scherer-2/+3
2022-12-06Bless 32 bit testsOli Scherer-82/+120
2022-12-06Properly indent messagesOli Scherer-7/+13
2022-12-06Change CTFE backtraces to use `note` instead of `label` to preserve their orderOli Scherer-641/+1857
labels are reordered within the file in which they are reported, which can mess up the stack trace
2022-12-06Remove now-redundant file/line info from const backtracesOli Scherer-416/+416
2022-12-06Start emitting labels even if their pointed to file is not available locallyOli Scherer-0/+51
2022-12-06Auto merge of #105378 - matthiaskrgr:rollup-fjeorw5, r=matthiaskrgrbors-19/+127
Rollup of 9 pull requests Successful merges: - #104898 (Put all cached values into a central struct instead of just the stable hash) - #105004 (Fix `emit_unused_delims_expr` ICE) - #105174 (Suggest removing struct field from destructive binding only in shorthand scenario) - #105250 (Replace usage of `ResumeTy` in async lowering with `Context`) - #105286 (Add -Z maximal-hir-to-mir-coverage flag) - #105320 (rustdoc: simplify CSS selectors on top-doc and non-exhaustive toggles) - #105349 (Point at args in associated const fn pointers) - #105362 (Cleanup macro-expanded code in `rustc_type_ir`) - #105370 (Remove outdated syntax from trait alias pretty printing) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-06Skip test on s390x as LLD does not support the platformUlrich Weigand-0/+1
test/run-make/issue-71519 requires use of lld as linker, but lld does not currently support the s390x architecture.
2022-12-06Fix failing codegen tests on s390xUlrich Weigand-2/+6
Several codegen tests are currently failing due to making assumptions that are not valid for the s390x architecture: - catch-unwind.rs: fails due to inlining differences. Already ignored on another platform for the same reason. Solution: Ignore on s390x. - remap_path_prefix/main.rs: fails due to different alignment requirement for string constants. Solution: Do not test for the alignment requirement. - repr-transparent-aggregates-1.rs: many ABI assumptions. Already ignored on many platforms for the same reason. Solution: Ignore on s390x. - repr-transparent.rs: no vector ABI by default on s390x. Already ignored on another platform for a similar reason. Solution: Ignore on s390x. - uninit-consts.rs: hard-coded little-endian constant. Solution: Match both little- and big-endian versions. Fixes part of https://github.com/rust-lang/rust/issues/105383.
2022-12-06Rollup merge of #105349 - compiler-errors:point-at-assoc-ct-fn-ptr-arg, ↵Matthias Krüger-2/+4
r=cjgillot Point at args in associated const fn pointers Tiny follow-up to #105201, not so sure it's worth it but :shrug: The UI test example is a bit more compelling when it's `GlUniformScalar::FACTORY` r? `@cjgillot`
2022-12-06Rollup merge of #105320 - notriddle:notriddle/rustdoc-toggle-hideme-2, ↵Matthias Krüger-0/+10
r=GuillaumeGomez rustdoc: simplify CSS selectors on top-doc and non-exhaustive toggles This code uses a special `hideme` class anyway, so just style that.
2022-12-06Rollup merge of #105286 - willcrichton:maximal-hir-to-mir-coverage, r=cjgillotMatthias Krüger-0/+11
Add -Z maximal-hir-to-mir-coverage flag This PR adds a new unstable flag `-Z maximal-hir-to-mir-coverage` that changes the behavior of `maybe_lint_level_root_bounded`, pursuant to [a discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Mapping.20MIR.20to.20HIR). When enabled, this function will not search upwards for a lint root, but rather immediately return the provided HIR node ID. This change increases the granularity of the mapping between MIR locations and HIR nodes inside the `SourceScopeLocalData` data structures. This increase in granularity is useful for rustc consumers like [Flowistry](https://github.com/willcrichton/flowistry) that rely on getting source-mapping information about the MIR CFG that is as precise as possible. A test `maximal_mir_to_hir_coverage.rs` has been added to verify that this flag does not break anything. r? `@cjgillot` cc `@gavinleroy`
2022-12-06Rollup merge of #105250 - Swatinem:async-rm-resumety, r=oli-obkMatthias Krüger-16/+23
Replace usage of `ResumeTy` in async lowering with `Context` Replaces using `ResumeTy` / `get_context` in favor of using `&'static mut Context<'_>`. Usage of the `'static` lifetime here is technically "cheating", and replaces the raw pointer in `ResumeTy` and the `get_context` fn that pulls the correct lifetimes out of thin air. fixes https://github.com/rust-lang/rust/issues/104828 and https://github.com/rust-lang/rust/pull/104321#issuecomment-1336363077 r? `@oli-obk`
2022-12-06Rollup merge of #105174 - chenyukang:yukang/fix-105028-unused, r=eholkMatthias Krüger-1/+30
Suggest removing struct field from destructive binding only in shorthand scenario Fixes #105028
2022-12-06Rollup merge of #105004 - TaKO8Ki:fix-104897, r=wesleywiserMatthias Krüger-0/+49
Fix `emit_unused_delims_expr` ICE Fixes #104897 This is also related to #104433.
2022-12-06Check AArch64 branch-protection earlier in the pipeline.Jacob Bramley-2/+2
As suggested in #93516.
2022-12-06Auto merge of #105229 - saethlin:zst-writes-to-unions, r=oli-obkbors-34/+43
Re-enable removal of ZST writes to unions This was previously disabled because Miri was lazily allocating unsized locals. But we aren't doing that anymore since https://github.com/rust-lang/rust/pull/98831, so we can have this optimization back.
2022-12-06Rollup merge of #105340 - estebank:ice-ice-baby, r=compiler-errorsMatthias Krüger-0/+130
Avoid ICE by accounting for missing type Fix #105330
2022-12-06Rollup merge of #105339 - BoxyUwU:wf_ct_kind_expr, r=TaKO8KiMatthias Krüger-0/+42
support `ConstKind::Expr` in `is_const_evaluatable` and `WfPredicates::compute` Fixes #105205 Currently we haven't implemented a way to evaluate `ConstKind::Expr(Expr::Binop(Add, 1, 2))` so I just left that with a `FIXME` and a `delay_span_bug` since I have no idea how to do that and it would make this a much larger (and more complicated) PR :P
2022-12-06Rollup merge of #105318 - compiler-errors:issue-105304, r=jackh726Matthias Krüger-0/+37
Make `get_impl_future_output_ty` work with AFIT Fixes #105304
2022-12-06Rollup merge of #105310 - compiler-errors:issue-105288, r=eholkMatthias Krüger-0/+13
Be more careful about unresolved exprs in suggestion Fixes #105288
2022-12-06Rollup merge of #105287 - compiler-errors:issue-105275, r=eholkMatthias Krüger-0/+22
Synthesize substitutions for bad auto traits in dyn types Auto traits are stored as just `DefId`s inside a `dyn Trait`'s existential predicates list. This is usually fine, since auto traits are forbidden to have generics -- but this becomes a problem for an ill-formed auto trait. But since this will always result in an error, just synthesize some dummy (error) substitutions which are used at least to keep trait selection code happy about the number of substs in a trait ref. Fixes #104808
2022-12-06Rollup merge of #105254 - cjgillot:issue-105251, r=oli-obkMatthias Krüger-0/+28
Recurse into nested impl-trait when computing variance. Fixes https://github.com/rust-lang/rust/issues/105251
2022-12-06Rollup merge of #105098 - lyming2007:issue-103869-fix, r=eholkMatthias Krüger-0/+31
propagate the error from parsing enum variant to the parser and emit out While parsing enum variant, the error message always disappear Because the error message that emit out is from main error of parser The information of enum variant disappears while parsing enum variant with error We only check the syntax of expecting token, i.e, in case https://github.com/rust-lang/rust/issues/103869 It will error it without telling the message that this error is from pasring enum variant. Propagate the sub-error from parsing enum variant to the main error of parser by chaining it with map_err Check the sub-error before emitting the main error of parser and attach it. Fix https://github.com/rust-lang/rust/issues/103869
2022-12-06Rollup merge of #105005 - estebank:where-clause-lts, r=compiler-errorsMatthias Krüger-0/+74
On E0195 point at where clause lifetime bounds Fix #104733
2022-12-06make retagging work even with 'unstable' placesRalf Jung-29/+0
2022-12-06Replace usage of `ResumeTy` in async lowering with `Context`Arpad Borsos-16/+23
Replaces using `ResumeTy` / `get_context` in favor of using `&'static mut Context<'_>`. Usage of the `'static` lifetime here is technically "cheating", and replaces the raw pointer in `ResumeTy` and the `get_context` fn that pulls the correct lifetimes out of thin air.
2022-12-06add a test for #104260Takayuki Maeda-0/+14
2022-12-05review comment: add test caseEsteban Küber-1/+18
2022-12-05On E0195 point at where clause lifetime boundsEsteban Küber-0/+57
Fix #104733
2022-12-05Avoid ICE by accounting for missing typeEsteban Küber-0/+130
Fix #105330
2022-12-06Point at args in associated const fn pointersMichael Goulet-2/+4
2022-12-06Rollup merge of #105338 - estebank:other-impls, r=compiler-errorsYuki Okushi-393/+128
Tweak "the following other types implement trait" When *any* of the suggested impls is an exact match, *only* show the exact matches. This is particularly relevant for integer types. r? `@compiler-errors`
2022-12-06Rollup merge of #105324 - compiler-errors:gat-where-clause-binding-obl, ↵Yuki Okushi-3/+35
r=jackh726 Point at GAT `where` clause when an obligation is unsatisfied Slightly helps with #105306
2022-12-06Rollup merge of #105315 - fmease:norm-subst-iat, r=compiler-errorsYuki Okushi-0/+44
Normalize inherent associated types after substitution Fixes #105314. r? ````@cjgillot```` (#105224) ````@rustbot```` label F-inherent_associated_types