Commit Graph

200154 Commits

Author SHA1 Message Date
Ding Xiang Fei
4a5d2a561c
add diagram to explain the MIR structure 2022-09-15 10:08:14 +08:00
Ding Xiang Fei
c7d1c9b66f
add explanatory note 2022-09-15 10:08:13 +08:00
Ding Xiang Fei
635b57c2ed
enclose else block in terminating scope 2022-09-15 10:08:12 +08:00
Ding Xiang Fei
34f0c4502f
supplement for the missing or incomplete comments 2022-09-15 10:08:11 +08:00
Ding Xiang Fei
af591ebe4d
add test for #99975 2022-09-15 10:08:10 +08:00
Ding Xiang Fei
1b87ce0d40
reorder nesting scopes and declare bindings without drop schedule 2022-09-15 10:07:54 +08:00
Michael Goulet
7893ca74e5 Normalize struct types in confirm_builtin_unsize_candidate 2022-09-15 01:20:36 +00:00
bors
2cb9a65684 Auto merge of #101620 - cjgillot:compute_lint_levels_by_def, r=oli-obk
Compute lint levels by definition

Lint levels are currently computed once for the whole crate. Any code that wants to emit a lint depends on this single `lint_levels(())` query. This query contains the `Span` for each attribute that participates in the lint level tree, so any code that wants to emit a lint basically depends on the spans in all files in the crate.

Contrary to hard errors, we do not clear the incremental session on lints, so this implicit world dependency pessimizes incremental reuse. (And is furthermore invisible for allowed lints.)

This PR completes https://github.com/rust-lang/rust/pull/99634 (thanks for the initial work `@fee1-dead)` and includes it in the dependency graph.

The design is based on 2 queries:
1. `lint_levels_on(HirId) -> FxHashMap<LintId, LevelAndSource>` which accesses the attributes at the given `HirId` and processes them into lint levels.  The `TyCtxt` is responsible for probing the HIR tree to find the user-visible level.
2. `lint_expectations(())` which lists all the `#[expect]` attributes in the crate.

This PR also introduces the ability to reconstruct a `HirId` from a `DepNode` by encoding the local part of the `DefPathHash` and the `ItemLocalId` in the two `u64` of the fingerprint.  This allows for the dep-graph to directly recompute `lint_levels_on` directly, without having to force the calling query.

Closes https://github.com/rust-lang/rust/issues/95094.
Supersedes https://github.com/rust-lang/rust/pull/99634.
2022-09-15 00:01:17 +00:00
Andrew Pollack
88baf8f6f5 Adding backtrace off option for fuchsia targets 2022-09-14 23:54:40 +00:00
Nicholas Nethercote
0965a33779 Streamline register_res.
Turns out it's only ever passed a `Res::Def`.
2022-09-15 09:07:32 +10:00
Andrew Pollack
4279bd56fc Remove noop from test that expects no noop 2022-09-14 21:23:10 +00:00
Nixon Enraght-Moony
bcef483738 Add test for #101743 2022-09-14 22:19:43 +01:00
bors
750bd1a7ff Auto merge of #101313 - SparrowLii:mk_attr_id, r=cjgillot
make `mk_attr_id` part of `ParseSess`

Updates #48685

The current `mk_attr_id` uses the `AtomicU32` type, which is not very efficient and adds a lot of lock contention in a parallel environment.

This PR refers to the task list in #48685, uses `mk_attr_id` as a method of the `AttrIdGenerator` struct, and adds a new field `attr_id_generator` to `ParseSess`.

`AttrIdGenerator` uses the `WorkerLocal`, which has two advantages: 1. `Cell` is more efficient than `AtomicU32`, and does not increase any lock contention. 2. We put the index of the work thread in the first few bits of the generated `AttrId`, so that the `AttrId` generated in different threads can be easily guaranteed to be unique.

cc `@cjgillot`
2022-09-14 20:52:18 +00:00
Michael Goulet
4cdf264e6f cache collect_trait_impl_trait_tys 2022-09-14 20:50:52 +00:00
Michael Howell
1ec92c8fb8 rustdoc: add test cases for turning `[Vec<T>] into [Vec<T>]` 2022-09-14 13:41:29 -07:00
Santiago Pastorino
45d8049387
Get rid of 'b lifetime in lower_param_bounds_mut 2022-09-14 17:40:51 -03:00
Santiago Pastorino
861055094c
Pass ImplTraitContext as &, there's no need for that to be &mut 2022-09-14 17:39:52 -03:00
Santiago Pastorino
669f2d4550
Revert "Rollup merge of #101496 - spastorino:lower_lifetime_binder_api_changes, r=oli-obk"
This reverts commit 953a6b3da7, reversing
changes made to b5ffbd32d4.
2022-09-14 17:26:37 -03:00
Thom Chiovoloni
ac55092a14
Bump Unicode to version 15.0.0, regenerate tables 2022-09-14 13:21:19 -07:00
Michael Howell
75aa73db30 rustdoc: remove no-op rule a { background: transparent }
The background is transparent by default.

It was added in 5a01dbe67b to work around a bug
in the JavaScript syntax highlighting engine that rustdoc used at the time.
2022-09-14 13:09:32 -07:00
Guillaume Gomez
a528f68e79 Remove duplicate warnings 2022-09-14 20:23:19 +02:00
Philipp Krones
fd291483bc
Temporarily move clippy::unused_peekable to nursery 2022-09-14 20:13:30 +02:00
raldone01
59fe291cec Cleanup closures. 2022-09-14 20:11:45 +02:00
bors
6153d3cbe6 Auto merge of #101212 - eholk:dyn-star, r=compiler-errors
Initial implementation of dyn*

This PR adds extremely basic and incomplete support for [dyn*](https://smallcultfollowing.com/babysteps//blog/2022/03/29/dyn-can-we-make-dyn-sized/). The goal is to get something in tree behind a flag to make collaboration easier, and also to make sure the implementation so far is not unreasonable. This PR does quite a few things:

* Introduce `dyn_star` feature flag
* Adds parsing for `dyn* Trait` types
* Defines `dyn* Trait` as a sized type
* Adds support for explicit casts, like `42usize as dyn* Debug`
  * Including const evaluation of such casts
* Adds codegen for drop glue so things are cleaned up properly when a `dyn* Trait` object goes out of scope
* Adds codegen for method calls, at least for methods that take `&self`

Quite a bit is still missing, but this gives us a starting point. Note that this is never intended to become stable surface syntax for Rust, but rather `dyn*` is planned to be used as an implementation detail for async functions in dyn traits.

Joint work with `@nikomatsakis` and `@compiler-errors.`

r? `@bjorn3`
2022-09-14 18:10:51 +00:00
Your Name
73d6dd5098 Changes to rename target and update docs 2022-09-14 18:38:01 +01:00
Guillaume Gomez
e7d8ad62db Add check for missing CSS variables 2022-09-14 19:36:03 +02:00
Guillaume Gomez
0b037c17b8 Update theme check tests 2022-09-14 19:36:03 +02:00
Guillaume Gomez
fb42dae987 Simplify CSS parser to check themes 2022-09-14 19:36:03 +02:00
Camille Gillot
cb2949e642
Update compiler/rustc_macros/src/query.rs 2022-09-14 19:11:53 +02:00
Camille GILLOT
42a92eb54b Correct Key impl for HirId. 2022-09-14 19:06:48 +02:00
Camille GILLOT
1fcc440391 Add FIXME. 2022-09-14 19:06:39 +02:00
Camille GILLOT
fca0d8a10e Comment LintLevelSets. 2022-09-14 19:06:30 +02:00
Camille GILLOT
69613bb602 Bless ui test. 2022-09-14 19:06:27 +02:00
Camille GILLOT
bb61842048 Remove unused tool_name. 2022-09-14 19:06:09 +02:00
Camille GILLOT
ad09abc194 Move some code and add comments. 2022-09-14 19:06:05 +02:00
Camille GILLOT
bd45139cb0 Allow query system to recover a HirId. 2022-09-14 19:04:13 +02:00
Jack Huey
d657d1f4a1 Disallow defaults on type GATs 2022-09-14 13:03:01 -04:00
Deadbeef
eb19a8a620 Compute lint_levels by definition 2022-09-14 19:02:44 +02:00
Michael Howell
44d9b8d070 rustdoc: clean up CSS #titles using flexbox
This commit allows it to stop manually specifying pixel heights for the tabs
on search result pages. There's less messing with manual breakpoints and
less complex CSS selectors.
2022-09-14 09:47:50 -07:00
raldone01
f4ff6860dc Constify PartialEq for Ordering. 2022-09-14 18:31:53 +02:00
b-naber
6af8fb7936 address review again 2022-09-14 17:30:25 +02:00
bors
a926696384 Auto merge of #101805 - Dylan-DPC:rollup-mpdlbin, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #101433 (Emit a note that static bounds from HRTBs are a bug)
 - #101684 (smol grammar changes to README.md)
 - #101769 (rustdoc: remove redundant CSS `.out-of-band > span.since { position }`)
 - #101772 (Also replace the placeholder for the stable_features lint)
 - #101773 (rustdoc: remove outdated CSS `.content table` etc)
 - #101779 (Update test output for drop tracking)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-14 15:19:12 +00:00
Nixon Enraght-Moony
f69a6c2a80 jsondoclint: Fix TODO's 2022-09-14 16:14:15 +01:00
Nixon Enraght-Moony
6e21a28dda jsondoclint: More precise Path checks 2022-09-14 16:14:15 +01:00
Nixon Enraght-Moony
24c751b2ba Rustdoc-Json: Add test for extern_types 2022-09-14 16:14:15 +01:00
Nixon Enraght-Moony
393792da8d Remove check_missing_items.py 2022-09-14 16:14:15 +01:00
Nixon Enraght-Moony
5956b56ab2 jsondoclint: Document validator 2022-09-14 16:14:15 +01:00
Nixon Enraght-Moony
c98c7cbfa5 Primitives can appear in modules. 2022-09-14 16:14:15 +01:00
Nixon Enraght-Moony
41d35a97f9 jsondocck: Find path to Id's not in index 2022-09-14 16:14:15 +01:00
Nixon Enraght-Moony
5f1bc6fc5e jsondocck: Better errors 2022-09-14 16:14:15 +01:00