about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-05-02Rollup merge of #96610 - GuillaumeGomez:update-browser-ui-test, r=notriddleYuki Okushi-2/+1
Update browser-ui-test version to 0.9.0 It adds the command `screenshot` and disables the screenshot comparison by default. r? `@notriddle`
2022-05-02Rollup merge of #96571 - thomcc:bathroom-stall, r=Mark-SimulacrumYuki Okushi-0/+7
Add a bathroom stall to weird expressions test
2022-05-02Rollup merge of #96499 - jyn514:bootstrap-doctests, r=Mark-SimulacrumYuki Okushi-0/+11
Make it possible to write doctests for bootstrap This probably isn't super useful in practice, but it was easy to fix and avoids confusing errors about mismatched versions between beta and the default toolchain.
2022-05-01Auto merge of #96517 - ferrocene:pa-files-related-to-test, r=Mark-Simulacrumbors-11/+35
[compiletest] Extract code to detect files related to a test into a different function In the code that checks whether a test needs to be re-executed, compiletest checks the modification date of all the files related to the test. I need the list of files related to the test for other purposes inside compiletest, and while I could copy/paste the code `is_up_to_date` runs, that would produce incomplete results if more related files are added in the future. This PR extracts the code to detect related files into a separate function, allowing the rest of compiletest to access the same data. r? `@Mark-Simulacrum`
2022-05-01Auto merge of #96521 - petrochenkov:docrules, r=notriddle,GuillaumeGomezbors-27/+147
rustdoc: Resolve doc links referring to `macro_rules` items cc https://github.com/rust-lang/rust/issues/81633 UPD: the fallback to considering *all* `macro_rules` in the crate for unresolved names is not removed in this PR, it will be removed separately and will be run through crater.
2022-05-01Update browser-ui-test version to 0.9.0Guillaume Gomez-2/+1
2022-05-01Auto merge of #96549 - ouz-a:mir-opt, r=oli-obkbors-140/+32
Move Derefer before Retag _Follow up work to #96116 #95857 #95649_ This moves `Derefer` before `Retag` and creates a new `LocalInfo` called `Temp` to avoid retagging created temp values. Zulip discussion [link](https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/deref.20as.20first.20and.20only.20projection) r? `@oli-obk`
2022-05-01Auto merge of #96376 - scottmcm:do-yeet, r=oli-obkbors-18/+164
Add `do yeet` expressions to allow experimentation in nightly Two main goals for this: - Ensure that trait restructuring in https://github.com/rust-lang/rust/issues/84277#issuecomment-1066120333 doesn't accidentally close us off from the possibility of doing this in future, as sketched in https://rust-lang.github.io/rfcs/3058-try-trait-v2.html#possibilities-for-yeet - Experiment with the *existence* of syntax for this, to be able to weight the syntax-vs-library tradeoffs better than we can right now. Notably the syntax (with `do`) and name in this PR are not intended as candidates for stabilization, but they make a good v0 PR for adding this with minimal impact to compiler maintenance or priming one possible name choice over another. r? `@oli-obk` The lang `second` for doing this: https://github.com/rust-lang/lang-team/issues/160#issuecomment-1107896716 Tracking issues - Lang, https://github.com/rust-lang/rust/issues/96373 - Libs-api, https://github.com/rust-lang/rust/issues/96374
2022-05-01Auto merge of #96576 - oli-obk:post_monomorphization_error_backtrace, r=lqdbors-0/+94
Also report the call site of PME errors locally. Note this does not produce a full stack all the way to the first call that specifies all monomorphic parameters, it's just shallowly mentioning the last call site. previous work: https://github.com/rust-lang/rust/pull/85633 tracking issue: https://github.com/rust-lang/rust/issues/85155 r? `@lqd` I figured we could get some improvement for traces in local crates without going into the backtrace hell you landed in last time
2022-05-01Auto merge of #96490 - dtolnay:writetmpbackport, r=Mark-Simulacrumbors-7/+7
Make [e]println macros eagerly drop temporaries (for backport) This PR extracts the subset of #96455 which is only the parts necessary for fixing the 1.61-beta regressions in #96434. My larger PR #96455 contains a few other changes relative to the pre-#94868 behavior; those are not necessary to backport into 1.61. argument position | before #94868 | after #94868 | after this PR --- |:---:|:---:|:---: `write!($tmp, "…", …)` | :rage: | :rage: | :rage: `write!(…, "…", $tmp)` | :rage: | :rage: | :rage: `writeln!($tmp, "…", …)` | :rage: | :rage: | :rage: `writeln!(…, "…", $tmp)` | :rage: | :rage: | :rage: `print!("…", $tmp)` | :rage: | :rage: | :rage: `println!("…", $tmp)` | :smiley_cat: | :rage: | :smiley_cat: `eprint!("…", $tmp)` | :rage: | :rage: | :rage: `eprintln!("…", $tmp)` | :smiley_cat: | :rage: | :smiley_cat: `panic!("…", $tmp)` | :smiley_cat: | :smiley_cat: | :smiley_cat:
2022-04-30Revert "Bless coverage-reports after core macro blocks change"David Tolnay-4/+4
This reverts commit ac5c657a0801db84b29ea9b3ae322107756575b0.
2022-04-30Feature-gate `do yeet` inside `cfg`s tooScott McMurray-0/+40
2022-04-30Bless the UI testsScott McMurray-18/+28
2022-04-30Fix the rustfmt buildScott McMurray-0/+5
2022-04-30Fix the clippy buildScott McMurray-0/+1
2022-04-30Add `do yeet` expressions to allow experimentation in nightlyScott McMurray-0/+90
Using an obviously-placeholder syntax. An RFC would still be needed before this could have any chance at stabilization, and it might be removed at any point. But I'd really like to have it in nightly at least to ensure it works well with try_trait_v2, especially as we refactor the traits.
2022-05-01rustdoc: Track `macro_rules` scopes during early doc link resolutionVadim Petrochenkov-1/+86
This way links referring to `macro_rules` items are resolved correctly
2022-04-30rustdoc: Keep full `ParentScope` during early doc link resolutionVadim Petrochenkov-19/+30
2022-04-30rustdoc: Early-resolve doc links in all requested namespacesVadim Petrochenkov-13/+37
2022-04-30Auto merge of #96347 - estebank:issue-96292, r=compiler-errorsbors-5/+65
Erase type params when suggesting fully qualified path When suggesting the use of a fully qualified path for a method call that is ambiguous because it has multiple candidates, erase type params in the resulting code, as they would result in an error when applied. We replace them with `_` in the output to rely on inference. There might be cases where this still produces slighlty incomplete suggestions, but it otherwise produces many more errors in relatively common cases. Fix #96292
2022-04-30Bless nll tests.Camille GILLOT-28/+45
2022-04-30Save colon span to suggest bounds.Camille GILLOT-5/+5
2022-04-30Bless tests.Camille GILLOT-298/+527
2022-04-30Store all generic bounds as where predicates.Camille GILLOT-98/+156
2022-04-30Inline WhereClause into Generics.Camille GILLOT-10/+9
2022-04-30Box HIR Generics and Impl.Camille GILLOT-3/+3
2022-04-30Also report the call site of PME errors locally.Oli Scherer-0/+94
Note this does not produce a full stack all the way to the first call that specifies all monomorphic parameters, it's just shallowly mentioning the last call site.
2022-04-30Auto merge of #95776 - cjgillot:ast-lifetimes-static, r=petrochenkovbors-76/+244
Enforce static lifetimes in consts during late resolution This PR moves the handling of implicitly and explicitly static lifetimes in constants from HIR to the AST.
2022-04-29Add a bathroom stall to weird expressions testThom Chiovoloni-0/+7
2022-04-30When encountering a binding that could be a const or unit variant, suggest ↵Esteban Kuber-43/+40
the right path
2022-04-30Bless tests.Camille GILLOT-67/+225
2022-04-29Auto merge of #96566 - Dylan-DPC:rollup-fo7rd98, r=Dylan-DPCbors-285/+326
Rollup of 6 pull requests Successful merges: - #96390 (Switch JS code to ES6 - part 2) - #96527 (RustWrapper: explicitly don't handle DXILPointerTyID) - #96536 (rustdoc: fix missing method list for primitive deref target) - #96559 (Use the correct lifetime binder for elided lifetimes in path.) - #96560 (Remove unnecessary environment variable in cf-protection documentation) - #96562 (Fix duplicate directory separator in --remap-path-prefix.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-04-29Rollup merge of #96562 - michaelwoerister:path-remapping-fixes, r=oli-obkDylan DPC-1/+1
Fix duplicate directory separator in --remap-path-prefix. The compiler will currently emit duplicate directory separators when `--remap-path-prefix` has an exact match of the working directory and it is invoked with a relative path to the main source file. For example ```bash rustc src/main.rs -Cdebuginfo=2 --remap-path-prefix="$(pwd)=abc" ``` will produce the path `abc//src/main.rs` in debuginfo. This is because `some_path.join("")` will append a directory separator to `some_path` and then LLVM does not check if the working directory already ends a directory separator before concatenating it with the relative path.
2022-04-29Rollup merge of #96560 - abrown:update-docs, r=Dylan-DPCDylan DPC-1/+1
Remove unnecessary environment variable in cf-protection documentation Before merging the `cf-protection` flag, it was necessary to use a locally-compiled version of `rustc`. This is no longer the case and the documentation should reflect this.
2022-04-29Rollup merge of #96559 - cjgillot:elided-path-fn, r=petrochenkovDylan DPC-0/+19
Use the correct lifetime binder for elided lifetimes in path. Fixes https://github.com/rust-lang/rust/issues/96540
2022-04-29Rollup merge of #96536 - rust-lang:notriddle/deref-slice-core, r=GuillaumeGomezDylan DPC-38/+72
rustdoc: fix missing method list for primitive deref target This change makes it so that local impls count when listing primitives that need retained. Fixes #95325
2022-04-29Rollup merge of #96390 - GuillaumeGomez:es6-part2, r=notriddleDylan DPC-245/+233
Switch JS code to ES6 - part 2 Part of #93058. It's based on https://github.com/rust-lang/rust/pull/96361 so it needs to wait for it to be merged first. r? `@notriddle`
2022-04-29Auto merge of #95819 - oli-obk:mir_can't_hold_all_these_lifetimes, r=estebankbors-55/+131
Enforce Copy bounds for repeat elements while considering lifetimes fixes https://github.com/rust-lang/rust/issues/95477 this is a breaking change in order to fix a soundness bug. Before this PR we only checked whether the repeat element type had an `impl Copy`, but not whether that impl also had the appropriate lifetimes. E.g. if the impl was for `YourType<'static>` and not a general `'a`, then copying any type other than a `'static` one should have been rejected, but wasn't. r? `@lcnr`
2022-04-29Fix duplicate directory separator in --remap-path-prefix.Michael Woerister-1/+1
2022-04-29Remove unnecessary environment variable in cf-protection documentationAndrew Brown-1/+1
Before merging the `cf-protection` flag, it was necessary to use a locally-compiled version of `rustc`. This is no longer the case and the documentation should reflect this.
2022-04-29Use the correct lifetime binder for elided lifetimes in path.Camille GILLOT-0/+19
2022-04-29rustdoc: prevent B -> C -> B -> C loops from stack overflowingMichael Howell-3/+12
2022-04-29Bless tests.Camille GILLOT-9/+19
2022-04-29remove and blessouz-a-4/+0
2022-04-29Auto merge of #96468 - davidtwco:diagnostic-translation-subdiagnostic, r=oli-obkbors-80/+1090
macros: subdiagnostic derive Add a new macro, `#[derive(SessionSubdiagnostic)]`, which can be applied to structs that represent subdiagnostics, such as labels, notes, helps or suggestions. `#[derive(SessionSubdiagnostic)]` can be used with the existing `#[derive(SessionDiagnostic)]`. All diagnostics implemented using either derive are translatable, and this new derive should make it easier to port existing diagnostics to using these derives. For example, consider the following subdiagnostic types... ```rust #[derive(SessionSubdiagnostic)] pub enum ExpectedIdentifierLabel<'tcx> { #[label(slug = "parser-expected-identifier")] WithoutFound { #[primary_span] span: Span, } #[label(slug = "parser-expected-identifier-found")] WithFound { #[primary_span] span: Span, found: String, } } #[derive(SessionSubdiagnostic)] #[suggestion_verbose(slug = "parser-raw-identifier")] pub struct RawIdentifierSuggestion<'tcx> { #[primary_span] span: Span, #[applicability] applicability: Applicability, ident: Ident, } ``` ...and the corresponding Fluent messages: ```fluent parser-expected-identifier = expected identifier parser-expected-identifier-found = expected identifier, found {$found} parser-raw-identifier = escape `{$ident}` to use it as an identifier ``` These can be emitted using the new `subdiagnostic` function on `Diagnostic`... ```rust diag.subdiagnostic(ExpectedIdentifierLabel::WithoutFound { span }); diag.subdiagnostic(RawIdentifierSuggestion { span, applicability, ident }); ``` ...or as part of a larger `#[derive(SessionDiagnostic)]`: ```rust #[derive(SessionDiagnostic)] #[error(slug = "parser-expected-identifier")] pub struct ExpectedIdentifier { #[primary_span] span: Span, token_descr: String, #[subdiagnostic] label: ExpectedIdentifierLabel, #[subdiagnostic] raw_identifier_suggestion: Option<RawIdentifierSuggestion>, } ``` ```rust sess.emit_err(ExpectedIdentifier { ... }); ``` r? `@oli-obk` cc `@pvdrz`
2022-04-29exp-stuff-dirtyouz-a-136/+32
2022-04-29Rollup merge of #96523 - nbdd0121:windows, r=petrochenkovDylan DPC-0/+12
Add `@feat.00` symbol to symbols.o for COFF Fix #96498 This is based on top of #96444. r? ``@petrochenkov``
2022-04-29Rollup merge of #96516 - oli-obk:impl_trait_inference_accidental_permitted, ↵Dylan DPC-574/+113
r=jackh726 Revert diagnostic duplication and accidental stabilization fixes #96460 this is an accidental stabilization that we should put into the beta. I believe it is low-risk, because it was literally what we had before #94081 The effect on tests is massive, but mostly deduplication of diagnostics and some minor span changes.
2022-04-29Auto merge of #96444 - nbdd0121:used2, r=petrochenkovbors-0/+13
Use decorated names for linked_symbols on Windows Fix #96423 r? `@petrochenkov`
2022-04-29macros: add interop between diagnostic derivesDavid Wood-2/+13
Add `#[subdiagnostic]` field attribute to the diagnostic derive which is applied to fields that have types which use the subdiagnostic derive. Signed-off-by: David Wood <david.wood@huawei.com>