Skip to content

Commit a29424a

Browse files
committed
Auto merge of #68933 - Dylan-DPC:rollup-akz13kj, r=Dylan-DPC
Rollup of 7 pull requests Successful merges: - #68164 (Selectively disable sanitizer instrumentation) - #68413 (Add GitHub issue templates) - #68889 (Move the `hir().krate()` method to a query and remove the `Krate` dep node) - #68909 (Respect --nocapture in panic=abort test mode) - #68910 (Add myself to .mailmap) - #68919 (Remove HashStable impl for ast::Lifetime) - #68928 (clean up E0276 explanation) Failed merges: r? @ghost
2 parents fb29dfc + 9681544 commit a29424a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+680
-203
lines changed

.github/ISSUE_TEMPLATE/blank_issue.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
name: Blank Issue
3+
about: Create a blank issue.
4+
---

.github/ISSUE_TEMPLATE/bug_report.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: Bug Report
3+
about: Create a bug report for Rust.
4+
labels: C-bug
5+
---
6+
<!--
7+
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
8+
along with any information you feel relevant to replicating the bug.
9+
-->
10+
11+
I tried this code:
12+
13+
```rust
14+
<code>
15+
```
16+
17+
I expected to see this happen: *explanation*
18+
19+
Instead, this happened: *explanation*
20+
21+
### Meta
22+
<!--
23+
If you're using the stable version of the compiler, you should also check if the
24+
bug also exists in the beta or nightly versions.
25+
-->
26+
27+
`rustc --version --verbose`:
28+
```
29+
<version>
30+
```
31+
32+
<!--
33+
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
34+
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
35+
-->
36+
<details><summary>Backtrace</summary>
37+
<p>
38+
39+
```
40+
<backtrace>
41+
```
42+
43+
</p>
44+
</details>

.github/ISSUE_TEMPLATE/config.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Rust Programming Language Forum
4+
url: https://users.rust-lang.org
5+
about: Please ask and answer questions about Rust here.

.github/ISSUE_TEMPLATE/ice.md

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: Internal Compiler Error
3+
about: Create a report for an internal compiler error in rustc.
4+
labels: C-bug, I-ICE, T-compiler
5+
---
6+
<!--
7+
Thank you for finding an Internal Compiler Error! 🧊 If possible, try to provide
8+
a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for
9+
how to create smaller examples.
10+
11+
http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/
12+
13+
-->
14+
15+
### Code
16+
17+
```
18+
<code>
19+
```
20+
21+
22+
### Meta
23+
<!--
24+
If you're using the stable version of the compiler, you should also check if the
25+
bug also exists in the beta or nightly versions.
26+
-->
27+
28+
`rustc --version --verbose`:
29+
```
30+
<version>
31+
```
32+
33+
### Error output
34+
35+
```
36+
<output>
37+
```
38+
39+
<!--
40+
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
41+
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
42+
-->
43+
<details><summary><strong>Backtrace</strong></summary>
44+
<p>
45+
46+
```
47+
<backtrace>
48+
```
49+
50+
</p>
51+
</details>
52+
+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
name: Tracking Issue
3+
about: A tracking issue for a feature in Rust.
4+
title: Tracking Issue for XXX
5+
labels: C-tracking-issue
6+
---
7+
<!--
8+
Thank you for creating a tracking issue! 📜 Tracking issues are for tracking a
9+
feature from implementation to stabilisation. Make sure to include the relevant
10+
RFC for the feature if it has one. Otherwise provide a short summary of the
11+
feature and link any relevant PRs or issues, and remove any sections that are
12+
not relevant to the feature.
13+
14+
Remember to add team labels to the tracking issue.
15+
For a language team feature, this would e.g., be `T-lang`.
16+
Such a feature should also be labeled with e.g., `F-my_feature`.
17+
This label is used to associate issues (e.g., bugs and design questions) to the feature.
18+
-->
19+
20+
This is a tracking issue for the RFC "XXX" (rust-lang/rfcs#NNN).
21+
The feature gate for the issue is `#![feature(FFF)]`.
22+
23+
### About tracking issues
24+
25+
Tracking issues are used to record the overall progress of implementation.
26+
They are also uses as hubs connecting to other relevant issues, e.g., bugs or open design questions.
27+
A tracking issue is however *not* meant for large scale discussion, questions, or bug reports about a feature.
28+
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
29+
30+
### Steps
31+
<!--
32+
Include each step required to complete the feature. Typically this is a PR
33+
implementing a feature, followed by a PR that stabilises the feature. However
34+
for larger features an implementation could be broken up into multiple PRs.
35+
-->
36+
37+
- [ ] Implement the RFC (cc @rust-lang/XXX -- can anyone write up mentoring
38+
instructions?)
39+
- [ ] Adjust documentation ([see instructions on rustc-guide][doc-guide])
40+
- [ ] Stabilization PR ([see instructions on rustc-guide][stabilization-guide])
41+
42+
[stabilization-guide]: https://rust-lang.github.io/rustc-guide/stabilization_guide.html#stabilization-pr
43+
[doc-guide]: https://rust-lang.github.io/rustc-guide/stabilization_guide.html#documentation-prs
44+
45+
### Unresolved Questions
46+
<!--
47+
Include any open questions that need to be answered before the feature can be
48+
stabilised.
49+
-->
50+
51+
XXX --- list all the "unresolved questions" found in the RFC to ensure they are
52+
not forgotten
53+
54+
### Implementation history
55+
56+
<!--
57+
Include a list of all the PRs that were involved in implementing the feature.
58+
-->

.mailmap

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ Graydon Hoare <[email protected]> Graydon Hoare <[email protected]>
100100
Guillaume Gomez <[email protected]>
101101
Guillaume Gomez <[email protected]> ggomez <[email protected]>
102102
Guillaume Gomez <[email protected]> Guillaume Gomez <[email protected]>
103+
103104
104105
105106
Herman J. Radtke III <[email protected]> Herman J. Radtke III <[email protected]>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# `no_sanitize`
2+
3+
The tracking issue for this feature is: [#39699]
4+
5+
[#39699]: https://github.com/rust-lang/rust/issues/39699
6+
7+
------------------------
8+
9+
The `no_sanitize` attribute can be used to selectively disable sanitizer
10+
instrumentation in an annotated function. This might be useful to: avoid
11+
instrumentation overhead in a performance critical function, or avoid
12+
instrumenting code that contains constructs unsupported by given sanitizer.
13+
14+
The precise effect of this annotation depends on particular sanitizer in use.
15+
For example, with `no_sanitize(thread)`, the thread sanitizer will no longer
16+
instrument non-atomic store / load operations, but it will instrument atomic
17+
operations to avoid reporting false positives and provide meaning full stack
18+
traces.
19+
20+
## Examples
21+
22+
``` rust
23+
#![feature(no_sanitize)]
24+
25+
#[no_sanitize(address)]
26+
fn foo() {
27+
// ...
28+
}
29+
```

src/librustc/arena.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ macro_rules! arena_types {
127127
[] tys: rustc::ty::TyS<$tcx>,
128128

129129
// HIR types
130-
[few] hir_forest: rustc::hir::map::Forest<$tcx>,
130+
[few] hir_krate: rustc_hir::Crate<$tcx>,
131131
[] arm: rustc_hir::Arm<$tcx>,
132132
[] attribute: syntax::ast::Attribute,
133133
[] block: rustc_hir::Block<$tcx>,

src/librustc/dep_graph/dep_node.rs

+1-14
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
//! "infer" some properties for each kind of `DepNode`:
3636
//!
3737
//! * Whether a `DepNode` of a given kind has any parameters at all. Some
38-
//! `DepNode`s, like `Krate`, represent global concepts with only one value.
38+
//! `DepNode`s, like `AllLocalTraitImpls`, represent global concepts with only one value.
3939
//! * Whether it is possible, in principle, to reconstruct a query key from a
4040
//! given `DepNode`. Many `DepKind`s only require a single `DefId` parameter,
4141
//! in which case it is possible to map the node's fingerprint back to the
@@ -400,19 +400,6 @@ rustc_dep_node_append!([define_dep_nodes!][ <'tcx>
400400
// We use this for most things when incr. comp. is turned off.
401401
[] Null,
402402

403-
// Represents the `Krate` as a whole (the `hir::Krate` value) (as
404-
// distinct from the krate module). This is basically a hash of
405-
// the entire krate, so if you read from `Krate` (e.g., by calling
406-
// `tcx.hir().krate()`), we will have to assume that any change
407-
// means that you need to be recompiled. This is because the
408-
// `Krate` value gives you access to all other items. To avoid
409-
// this fate, do not call `tcx.hir().krate()`; instead, prefer
410-
// wrappers like `tcx.visit_all_items_in_krate()`. If there is no
411-
// suitable wrapper, you can use `tcx.dep_graph.ignore()` to gain
412-
// access to the krate, but you must remember to add suitable
413-
// edges yourself for the individual items that you read.
414-
[eval_always] Krate,
415-
416403
// Represents the body of a function or method. The def-id is that of the
417404
// function/method.
418405
[eval_always] HirBody(DefId),

src/librustc/hir/map/collector.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,9 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
223223
(commandline_args_hash, crate_disambiguator.to_fingerprint()),
224224
);
225225

226-
let (_, crate_hash) = input_dep_node_and_hash(
227-
self.dep_graph,
228-
&mut self.hcx,
229-
DepNode::new_no_params(DepKind::Krate),
230-
crate_hash_input,
231-
);
226+
let mut stable_hasher = StableHasher::new();
227+
crate_hash_input.hash_stable(&mut self.hcx, &mut stable_hasher);
228+
let crate_hash: Fingerprint = stable_hasher.finish();
232229

233230
let svh = Svh::new(crate_hash.to_smaller_hash());
234231
(self.map, svh)

src/librustc/hir/map/hir_id_validator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub fn check_crate(hir_map: &Map<'_>) {
1212

1313
let errors = Lock::new(Vec::new());
1414

15-
par_iter(&hir_map.krate().modules).for_each(|(module_id, _)| {
15+
par_iter(&hir_map.krate.modules).for_each(|(module_id, _)| {
1616
let local_def_id = hir_map.local_def_id(*module_id);
1717
hir_map.visit_item_likes_in_module(
1818
local_def_id,

0 commit comments

Comments
 (0)