Commit Graph

691 Commits

Author SHA1 Message Date
Matthias Krüger
1d4397ba70
Rollup merge of #107964 - notriddle:notriddle/title-line-height, r=GuillaumeGomez
rustdoc: use tighter line height in h1 and h2

This keeps the line height for body text the same, as required by WCAG, but for headers, it makes sense to have wrapped lines be a bit tighter packed.

## Before

![image](https://user-images.githubusercontent.com/1593513/218332683-88a02467-7811-4e6b-81f8-67dded691465.png)

## After

![image](https://user-images.githubusercontent.com/1593513/218332698-a1b2a265-0658-4306-8473-b835f663172d.png)
2023-02-12 22:29:50 +01:00
Matthias Krüger
f81cb97cb2
Rollup merge of #107955 - RalfJung:ancient-ub, r=jyn514
fix UB in ancient test

This seems to go back all the way to the [original version of this test](b9aa9def85/src/test/run-pass/regions-mock-trans.rs) from ten years ago... ``@nikomatsakis`` trip down memory lane? ;)

Clearly deallocation is a form of mutation so doing it to a (pointer derived from a) shared reference cannot be legal. Let's use mutable references instead.
2023-02-12 22:29:49 +01:00
Matthias Krüger
9b503325b4
Rollup merge of #107934 - notriddle:notriddle/intra-doc-link-meta-description, r=camelid,GuillaumeGomez
rustdoc: account for intra-doc links in `<meta name="description">`

Similar to #86451, but for the SEO descriptions instead of the search descriptions.
2023-02-12 22:29:48 +01:00
Michael Howell
b0df355f80 rustdoc: use tighter line height in h1 and h2 2023-02-12 12:30:57 -07:00
Ralf Jung
0ea0c90d58 fix UB in ancient test 2023-02-12 16:30:37 +01:00
bors
51cb5614dd Auto merge of #105601 - BelovDV:change-rlib-with-not-stable, r=petrochenkov
Enable new rlib in non stable cases

If bundled static library uses cfg (unstable) or whole-archive (wasn't supported) bundled libs are packed even without packed_bundled_libs.

r? `@petrochenkov`
2023-02-12 07:15:27 +00:00
Michael Howell
72b3f46b43 rustdoc: account for intra-doc links in <meta name="description"> 2023-02-11 16:10:28 -07:00
bors
585f3eef26 Auto merge of #107851 - cjgillot:sroa-const, r=oli-obk
Put deaggregated statements after original constant.

Fixes https://github.com/rust-lang/rust/issues/107818
2023-02-11 20:59:18 +00:00
bors
2b3f260e74 Auto merge of #107928 - matthiaskrgr:rollup-qnn380r, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #107657 (Add only modified subcommand for compiletest)
 - #107864 (rustdoc: clean up `write!` calls with less stuttering)
 - #107873 (Emit JSON output for the building of bootstrap itself)
 - #107895 (remove redundant clones)
 - #107897 (Reexported macros docs)
 - #107909 (rustdoc: remove redundant `if s.is_empty()` from `find_testable_code`)
 - #107912 (rustdoc: Don't resolve link to field on different variant)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-02-11 18:01:17 +00:00
Matthias Krüger
c8614a7479
Rollup merge of #107912 - clubby789:doc-bad-enum-field, r=camelid,GuillaumeGomez
rustdoc: Don't resolve link to field on different variant

Fix #107903

This also gives a more specific diagnostic when the enum has any fields
2023-02-11 17:18:45 +01:00
Matthias Krüger
1305119a3f
Rollup merge of #107897 - GuillaumeGomez:reexported-macros-docs, r=notriddle
Reexported macros docs

Part of #59368 (doesn't fix it, only improve the current situation a bit).

Macros were not correctly handled in reexports and the reexport attributes were not merged with the item either. This PR fixes both.

r? `@notriddle`
2023-02-11 17:18:44 +01:00
bors
8dabf5da9e Auto merge of #107167 - the8472:rawvec-simpler-layout, r=thomcc
simplify layout calculations in rawvec

The use of `Layout::array` was introduced in #83706 which lead to a [perf regression](https://github.com/rust-lang/rust/pull/83706#issuecomment-1048377719).

This PR basically reverts that change since rust currently only supports stride == size types, but to be on the safe side it leaves a const-assert there to make sure this gets caught if those assumptions ever change.
2023-02-11 15:08:30 +00:00
clubby789
ef8de38c84 rustdoc: Don't resolve link to field on different variant 2023-02-11 12:28:35 +00:00
bors
71f6675de1 Auto merge of #107919 - Dylan-DPC:rollup-fkl9swa, r=Dylan-DPC
Rollup of 9 pull requests

Successful merges:

 - #105019 (Add parentheses properly for borrowing suggestion)
 - #106001 (Stop at the first `NULL` argument when iterating `argv`)
 - #107098 (Suggest function call on pattern type mismatch)
 - #107490 (rustdoc: remove inconsistently-present sidebar tooltips)
 - #107855 (Add a couple random projection tests for new solver)
 - #107857 (Add ui test for implementation on projection)
 - #107878 (Clarify `new_size` for realloc means bytes)
 - #107888 (revert #107074, add regression test)
 - #107900 (Zero the `REPARSE_MOUNTPOINT_DATA_BUFFER` header)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-02-11 09:19:07 +00:00
bors
1623ab0246 Auto merge of #107507 - BoxyUwU:deferred_projection_equality, r=lcnr
Implement `deferred_projection_equality` for erica solver

Somewhat of a revival of #96912. When relating projections now emit an `AliasEq` obligation instead of attempting to determine equality of projections that may not be as normalized as possible (i.e. because of lazy norm, or just containing inference variables that prevent us from resolving an impl). Only do this when the new solver is enabled
2023-02-11 05:46:24 +00:00
Dylan DPC
745361d17d
Rollup merge of #107888 - lcnr:opaque-ty-validate, r=wesleywiser
revert #107074, add regression test

fixes #107346
2023-02-11 11:15:57 +05:30
Dylan DPC
2228c86bad
Rollup merge of #107857 - GuillaumeGomez:ui-test-impl-projections, r=oli-obk
Add ui test for implementation on projection

The error in full can be seen in https://github.com/rust-lang/rust/pull/107263 and is part of why the PR is blocked (it still requires the approval from the team for supporting it).

r? ``@oli-obk``
2023-02-11 11:15:56 +05:30
Dylan DPC
27454012c1
Rollup merge of #107855 - compiler-errors:new-solver-random-tests, r=lcnr
Add a couple random projection tests for new solver

Self-explanatory, they're just some cases that have been on my mind in the past (especially `tests/ui/traits/new-solver/param-candidate-doesnt-shadow-project.rs`).
2023-02-11 11:15:56 +05:30
Dylan DPC
9af90ffa3c
Rollup merge of #107490 - notriddle:notriddle/rm-sidebar-tooltip, r=GuillaumeGomez
rustdoc: remove inconsistently-present sidebar tooltips

Discussed in https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Inconsistent.20sidebar.20tooltips/near/323565625
2023-02-11 11:15:55 +05:30
Dylan DPC
400b03ac3c
Rollup merge of #107098 - compiler-errors:pat-mismatch-fn-call, r=lcnr
Suggest function call on pattern type mismatch

Fixes #101208

This could definitely be generalized to support more suggestions in pattern matches. We can't use all of [`FnCtxt::emit_type_mismatch_suggestions`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck/fn_ctxt/struct.FnCtxt.html#method.emit_type_mismatch_suggestions), but it's on my to-do list to play around with more suggestions that would be productive in this position.
2023-02-11 11:15:55 +05:30
Dylan DPC
0781d5dd8e
Rollup merge of #105019 - chenyukang:yukang/fix-104961-borrow, r=cjgillot
Add parentheses properly for borrowing suggestion

Fixes #104961
2023-02-11 11:15:54 +05:30
bors
5a8dfd933a Auto merge of #85158 - JulianKnodt:array_const_val, r=cjgillot
Mir-Opt for copying enums with large discrepancies

I have been meaning to make this for quite a while, based off of this [hackmd](https://hackmd.io/`@ft4bxUsFT5CEUBmRKYHr7w/rJM8BBPzD).`

I'm not sure where to put this opt now that I've made it, so I'd appreciate suggestions on that!
It's also one long chain of statements, not sure if there's a more friendly format to make it.

r? `@tmiasko`
I would `r` oli but he's on leave so he suggested I `r` tmiasko or wesleywiser.
2023-02-10 21:49:31 +00:00
Michael Goulet
0eba2f3c16 Suggest fn call on pattern type mismatch 2023-02-10 18:18:08 +00:00
Michael Goulet
9790d6fbdd Add a couple random projection tests 2023-02-10 18:14:09 +00:00
Guillaume Gomez
295fd0d835 Add regression test for reexported macros docs 2023-02-10 18:37:32 +01:00
Boxy
4c98429d8c Add tests 2023-02-10 14:56:28 +00:00
Matthias Krüger
d494cd3eab
Rollup merge of #107836 - chenyukang:yukang/fix-107822, r=oli-obk
Handle properly when there is no crate attrs

Fixes #107822

r? `@oli-obk`
2023-02-10 15:28:47 +01:00
Matthias Krüger
dc7559b599
Rollup merge of #107789 - jieyouxu:issue-107745, r=lcnr
Avoid exposing type parameters and implementation details sourced from macro expansions

Fixes #107745.

~~I would like to **request some guidance** for this issue, because I don't think this is a good fix (a band-aid at best).~~

### The Problem

The code

```rust
fn main() {
    println!("{:?}", []);
}
```

gets desugared into (`rustc +nightly --edition=2018 issue-107745.rs -Z unpretty=hir`):

```rust
#[prelude_import]
use std::prelude::rust_2018::*;
#[macro_use]
extern crate std;
fn main() {
        {
                ::std::io::_print(<#[lang = "format_arguments"]>::new_v1(&["",
                                    "\n"], &[<#[lang = "format_argument"]>::new_debug(&[])]));
            };
    }
```

so the diagnostics code tries to be as specific and helpful as possible, and I think it finds that `[]` needs a type parameter and so does `new_debug`. But since `[]` doesn't have an origin for the type parameter definition, it points to `new_debug` instead and leaks the internal implementation detail since all `[]` has is an type inference variable.

### ~~The Bad Fix~~

~~This PR currently tries to fix the problem by bypassing the generated function `<#[lang = "format_argument"]>::new_debug` to avoid its generic parameter (I think it is auto-generated from the argument `[_; 0]`?) from getting collected as an `InsertableGenericArg`. This is problematic because it also prevents the help from getting displayed.~~

~~I think this fix is not ideal and hard-codes the format generated code pattern, but I can't think of a better fix. I have tried asking on Zulip but no responses there yet.~~
2023-02-10 15:28:47 +01:00
lcnr
3a72238aa6 revert #107074 2023-02-10 15:24:39 +01:00
Guillaume Gomez
a03da2bdeb Add test for implementation on projection 2023-02-10 14:44:54 +01:00
bors
d1ac43a9b9 Auto merge of #107652 - estebank:re_error, r=oli-obk
Introduce `ReError`

CC #69314

r? `@nagisa`
2023-02-10 10:10:12 +00:00
Daniil Belov
601fc8b36b [link] enable packed bundled lib in non stable cases 2023-02-10 12:51:12 +03:00
yukang
257389882d add test for no input file 2023-02-10 08:02:56 +00:00
bors
9b8dbd558c Auto merge of #107870 - matthiaskrgr:rollup-3z1q4rm, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #107043 (Support `true` and `false` as boolean flag params)
 - #107831 (Query refactoring)
 - #107841 (Handled snap curl issue inside Rust)
 - #107852 (rustdoc: remove unused fn parameter `tab`)
 - #107861 (Sync release notes for 1.67.1)
 - #107863 (Allow multiple candidates with same response in new solver)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-02-10 06:20:01 +00:00
Matthias Krüger
9300617dab
Rollup merge of #107863 - compiler-errors:new-solver-multiple-candidates, r=jackh726
Allow multiple candidates with same response in new solver

Treat >1 candidates as *not* ambiguous if they return the same response.
2023-02-10 06:09:59 +01:00
Matthias Krüger
8fc9ed51f0
Rollup merge of #107043 - Nilstrieb:true-and-false-is-false, r=wesleywiser
Support `true` and `false` as boolean flag params

Implements [MCP 577](https://github.com/rust-lang/compiler-team/issues/577).
2023-02-10 06:09:56 +01:00
bors
a697573463 Auto merge of #101680 - jackh726:implied-cleanup, r=lcnr
Fix implied outlives bounds logic for projections

The logic here is subtly wrong. I put a bit of an explanation in a767d7b5165cea8ee5cbe494a4a636c50ef67c9c.

TL;DR: we register outlives predicates to be proved, because wf code normalizes projections (from the unnormalized types) to type variables. This causes us to register those as constraints instead of implied. This was "fine", because we later added that implied bound in the normalized type, and delayed registering constraints. When I went to cleanup `free_region_relations` to *not* delay adding constraints, this bug was uncovered.

cc. `@aliemjay` because this caused your test failure in #99832 (I only realized as I was writing this)

r? `@nikomatsakis`
2023-02-10 03:21:39 +00:00
Jack Huey
1a663c0f53 Cleanup free_region_relations a bit 2023-02-09 20:38:27 -05:00
Michael Goulet
3c4e1f85cb Multiple candidates with same response is not ambiguous 2023-02-10 00:35:25 +00:00
bors
a12d31d5a6 Auto merge of #102963 - ilammy:xray-basic, r=estebank
Add `-Z instrument-xray` flag

Implement MCP https://github.com/rust-lang/compiler-team/issues/561, adding `-Z instrument-xray` flag which enables XRay instrumentation in LLVM.
2023-02-10 00:02:43 +00:00
Dylan DPC
b080a1a4fc
Rollup merge of #107815 - compiler-errors:new-solver-no-auto-if-impl, r=lcnr
Disqualify `auto trait` built-in impl in new solver if explicit `impl` exists
2023-02-09 23:18:37 +05:30
Dylan DPC
16a4138387
Rollup merge of #107803 - eggyal:do_not_bring_trait_alias_supertraits_into_scope, r=compiler-errors
Do not bring trait alias supertraits into scope

Fixes #107747
cc #41517
2023-02-09 23:18:36 +05:30
Dylan DPC
39ba11036a
Rollup merge of #107786 - compiler-errors:new-solver-some-tweaks, r=lcnr
Implement some tweaks in the new solver

I've been testing the new solver on some small codebases, and these are a few small changes I've needed to make.

The most "controversial" here is implementing `trait_candidate_should_be_dropped_in_favor_of`, which I just implemented to always return false. This surprisingly allows some code to compile, without us having to actually decide on any semantics yet.

r? `@rust-lang/initiative-trait-system-refactor`
2023-02-09 23:18:35 +05:30
Dylan DPC
5aa062e249
Rollup merge of #107659 - bvanjoi:issue-107649, r=estebank
test: snapshot for derive suggestion in diff files

fixed #107649
2023-02-09 23:18:35 +05:30
Dylan DPC
188dd72b5f
Rollup merge of #107655 - notriddle:notriddle/small-url-encode, r=GuillaumeGomez
rustdoc: use the same URL escape rules for fragments as for examples

Carries over improvements from #107284
2023-02-09 23:18:34 +05:30
Dylan DPC
be1789a56d
Rollup merge of #107648 - matthiaskrgr:unused_lifetime_104432_fix, r=cjgillot
unused-lifetimes: don't warn about lifetimes originating from expanded code

previously, we would warn like this:

````
warning: lifetime parameter `'s` never used
 --> /tmp/unusedlif/code.rs:6:62
  |
5 | #[derive(Clone)]
  |          - help: elide the unused lifetime
6 | struct ShimMethod4<T: Trait2 + 'static>(pub &'static dyn for<'s> Fn(&'s mut T::As));
  |                                                              ^^
  |
  = note: requested on the command line with `-W unused-lifetimes`
````

Fixes #104432
2023-02-09 23:18:34 +05:30
Camille GILLOT
221ea3080d Put deaggregated statements after original constant. 2023-02-09 17:27:31 +00:00
Michael Goulet
68e27b3052 Disqualify auto-trait builtin impl in new solver if impl exists 2023-02-09 17:23:50 +00:00
Michael Goulet
8987e68247 Implement a dummy drop-in-favor-of for the new solver 2023-02-09 17:22:37 +00:00
Michael Goulet
8c67ecd124 Use elaborated item bounds for alias types 2023-02-09 17:16:47 +00:00