Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 14 pull requests #79920

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
72a5cbb
Edit documentation for `std::{f32,f64}::mul_add`.
fu5ha Sep 21, 2020
a6d98d8
generalize warning
fu5ha Oct 13, 2020
87c1fdb
Make the kernel_copy tests more robust/concurrent.
vext01 Nov 24, 2020
36363e5
Refine E0212 error message
sasurau4 Dec 4, 2020
a1e94cd
Add long explanation for E0212
sasurau4 Dec 2, 2020
87c6216
Update some associated-types ui test suites
sasurau4 Dec 2, 2020
12db222
Dogfood 'str_split_once() with `compiler/`
Eric-Arellano Dec 7, 2020
d6baf38
Dogfood 'str_split_once() with Tidy
Eric-Arellano Dec 7, 2020
7bd47bd
Dogfood 'str_split_once() with linkchecker
Eric-Arellano Dec 7, 2020
85e9ea0
Dogfood 'str_split_once() with librustdoc
Eric-Arellano Dec 7, 2020
d2de69d
Dogfood 'str_split_once()` in the std lib
Eric-Arellano Dec 7, 2020
f68cc68
Review feedback for collect_intra_doc_links.rs
Eric-Arellano Dec 7, 2020
a3174de
Fix net.rs - rsplitn() returns a reverse iterator
Eric-Arellano Dec 7, 2020
989edf4
Review feedback
Eric-Arellano Dec 8, 2020
4e21942
Clarify the 'default is only allowed on...' error
camelid Dec 9, 2020
33ae62c
Clarify that String::split_at takes a byte index.
frewsxcv Dec 9, 2020
56d9784
Fix typo in `wrapping_shl` documentation
Pratyush Dec 9, 2020
594b451
Windows TLS: ManuallyDrop instead of mem::forget
RalfJung Dec 10, 2020
2363a20
Make search results tab and help button focusable with keyboard
GuillaumeGomez Dec 10, 2020
caab16f
Update const-fn doc in unstable-book
sasurau4 Dec 9, 2020
169c59f
Add some core::cmp::Ordering helpers
jnqnfe Dec 10, 2020
3918b82
Use `def_path_hash_to_def_id` when re-using a `RawDefId`
Aaron1011 Dec 10, 2020
40ed0f6
Use Symbol for inline asm register class names
Dec 10, 2020
f7306b1
Add tracking issue template for library features.
m-ou-se Dec 4, 2020
56c46f8
Rollup merge of #77027 - termhn:mul_add_doc_change, r=m-ou-se
Dylan-DPC Dec 10, 2020
d7502b4
Rollup merge of #79375 - vext01:kernel-copy-temps, r=bjorn3
Dylan-DPC Dec 10, 2020
c124229
Rollup merge of #79639 - sasurau4:feature/add-long-explanation-E0212,…
Dylan-DPC Dec 10, 2020
57a2216
Rollup merge of #79656 - jnqnfe:ordering, r=sfackler
Dylan-DPC Dec 10, 2020
6e26af9
Rollup merge of #79698 - m-ou-se:libs-tracking-issue-template, r=KodrAus
Dylan-DPC Dec 10, 2020
63bc8ce
Rollup merge of #79809 - Eric-Arellano:split-once, r=matklad
Dylan-DPC Dec 10, 2020
d278665
Rollup merge of #79851 - camelid:better-error-for-default-fn, r=david…
Dylan-DPC Dec 10, 2020
d2e11c5
Rollup merge of #79858 - sasurau4:doc/update-unstable-book-const-fn, …
Dylan-DPC Dec 10, 2020
f053d6b
Rollup merge of #79860 - rust-lang:frewsxcv-patch-2, r=jyn514
Dylan-DPC Dec 10, 2020
e28134c
Rollup merge of #79871 - Pratyush:patch-1, r=joshtriplett
Dylan-DPC Dec 10, 2020
e72720b
Rollup merge of #79893 - RalfJung:forget-windows, r=oli-obk
Dylan-DPC Dec 10, 2020
dfc3dc1
Rollup merge of #79896 - GuillaumeGomez:more-elements-focus, r=Manish…
Dylan-DPC Dec 10, 2020
75e5d21
Rollup merge of #79915 - Aaron1011:fix/fix-reuse-def-path-hash, r=pet…
Dylan-DPC Dec 10, 2020
c0c879e
Rollup merge of #79917 - sivadeilra:asm_symbols, r=petrochenkov
Dylan-DPC Dec 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/ISSUE_TEMPLATE/library_tracking_issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
name: Library Tracking Issue
about: A tracking issue for an unstable library feature.
title: Tracking Issue for XXX
labels: C-tracking-issue T-libs
---
<!--
Thank you for creating a tracking issue!

Tracking issues are for tracking a feature from implementation to stabilization.

Make sure to include the relevant RFC for the feature if it has one.

If the new feature is small, it may be fine to skip the RFC process. In that
case, you can use use `issue = "none"` in your initial implementation PR. The
reviewer will ask you to open a tracking issue if they agree your feature can be
added without an RFC.
-->

Feature gate: `#![feature(...)]`

This is a tracking issue for ...

<!--
Include a short description of the feature.
-->

### Public API

<!--
For most library features, it'd be useful to include a summarized version of the public API.
(E.g. just the public function signatures without their doc comments or implementation.)
-->

```rust
...
```

### Steps / History

<!--
In the simplest case, this is a PR implementing the feature followed by a PR
that stabilises the feature. However it's not uncommon for the feature to be
changed before stabilization. For larger features, the implementation could be
split up in multiple steps.
-->

- [ ] Implementation: ...
- [ ] Stabilization PR

### Unresolved Questions

<!--
Include any open questions that need to be answered before the feature can be
stabilised. If multiple (unrelated) big questions come up, it can be a good idea
to open a separate issue for each, to make it easier to keep track of the
discussions.

It's useful to link any relevant discussions and conclusions (whether on GitHub,
Zulip, or the internals forum) here.
-->

- None yet.
2 changes: 1 addition & 1 deletion compiler/rustc_ast_passes/src/ast_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ impl<'a> AstValidator<'a> {
if let Defaultness::Default(def_span) = defaultness {
let span = self.session.source_map().guess_head_span(span);
self.err_handler()
.struct_span_err(span, "`default` is only allowed on items in `impl` definitions")
.struct_span_err(span, "`default` is only allowed on items in trait impls")
.span_label(def_span, "`default` because of this")
.emit();
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_error_codes/src/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ E0206: include_str!("./error_codes/E0206.md"),
E0207: include_str!("./error_codes/E0207.md"),
E0210: include_str!("./error_codes/E0210.md"),
E0211: include_str!("./error_codes/E0211.md"),
E0212: include_str!("./error_codes/E0212.md"),
E0214: include_str!("./error_codes/E0214.md"),
E0220: include_str!("./error_codes/E0220.md"),
E0221: include_str!("./error_codes/E0221.md"),
Expand Down Expand Up @@ -503,7 +504,6 @@ E0779: include_str!("./error_codes/E0779.md"),
// E0196, // cannot determine a type for this closure
E0208,
// E0209, // builtin traits can only be implemented on structs or enums
E0212, // cannot extract an associated type from a higher-ranked trait bound
// E0213, // associated types are not accepted in this context
// E0215, // angle-bracket notation is not stable with `Fn`
// E0216, // parenthetical notation is only stable with `Fn`
Expand Down
35 changes: 35 additions & 0 deletions compiler/rustc_error_codes/src/error_codes/E0212.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Cannot use the associated type of
a trait with uninferred generic parameters.

Erroneous code example:

```compile_fail,E0212
pub trait Foo<T> {
type A;
fn get(&self, t: T) -> Self::A;
}
fn foo2<I : for<'x> Foo<&'x isize>>(
field: I::A) {} // error!
```

In this example, we have to instantiate `'x`, and
we don't know what lifetime to instantiate it with.
To fix this, spell out the precise lifetimes involved.
Example:

```
pub trait Foo<T> {
type A;
fn get(&self, t: T) -> Self::A;
}
fn foo3<I : for<'x> Foo<&'x isize>>(
x: <I as Foo<&isize>>::A) {} // ok!
fn foo4<'a, I : for<'x> Foo<&'x isize>>(
x: <I as Foo<&'a isize>>::A) {} // ok!
```
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/dep_graph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl<'tcx> DepContext for TyCtxt<'tcx> {

fn register_reused_dep_path_hash(&self, hash: DefPathHash) {
if let Some(cache) = self.queries.on_disk_cache.as_ref() {
cache.register_reused_dep_path_hash(hash)
cache.register_reused_dep_path_hash(*self, hash)
}
}

Expand Down
24 changes: 21 additions & 3 deletions compiler/rustc_middle/src/ty/query/on_disk_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ impl<'sess> OnDiskCache<'sess> {
fn try_remap_cnum(&self, tcx: TyCtxt<'_>, cnum: u32) -> Option<CrateNum> {
let cnum_map =
self.cnum_map.get_or_init(|| Self::compute_cnum_map(tcx, &self.prev_cnums[..]));
debug!("try_remap_cnum({}): cnum_map={:?}", cnum, cnum_map);

cnum_map[CrateNum::from_u32(cnum)]
}
Expand All @@ -466,9 +467,22 @@ impl<'sess> OnDiskCache<'sess> {
.insert(hash, RawDefId { krate: def_id.krate.as_u32(), index: def_id.index.as_u32() });
}

pub fn register_reused_dep_path_hash(&self, hash: DefPathHash) {
if let Some(old_id) = self.foreign_def_path_hashes.get(&hash) {
self.latest_foreign_def_path_hashes.lock().insert(hash, *old_id);
/// If the given `hash` still exists in the current compilation,
/// calls `store_foreign_def_id` with its current `DefId`.
///
/// Normally, `store_foreign_def_id_hash` can be called directly by
/// the dependency graph when we construct a `DepNode`. However,
/// when we re-use a deserialized `DepNode` from the previous compilation
/// session, we only have the `DefPathHash` available. This method is used
/// to that any `DepNode` that we re-use has a `DefPathHash` -> `RawId` written
/// out for usage in the next compilation session.
pub fn register_reused_dep_path_hash(&self, tcx: TyCtxt<'tcx>, hash: DefPathHash) {
// We can't simply copy the `RawDefId` from `foreign_def_path_hashes` to
// `latest_foreign_def_path_hashes`, since the `RawDefId` might have
// changed in the current compilation session (e.g. we've added/removed crates,
// or added/removed definitions before/after the target definition).
if let Some(def_id) = self.def_path_hash_to_def_id(tcx, hash) {
self.store_foreign_def_id_hash(def_id, hash);
}
}

Expand Down Expand Up @@ -592,6 +606,7 @@ impl<'sess> OnDiskCache<'sess> {
match cache.entry(hash) {
Entry::Occupied(e) => *e.get(),
Entry::Vacant(e) => {
debug!("def_path_hash_to_def_id({:?})", hash);
// Check if the `DefPathHash` corresponds to a definition in the current
// crate
if let Some(def_id) = self.local_def_path_hash_to_def_id.get(&hash).cloned() {
Expand All @@ -605,9 +620,11 @@ impl<'sess> OnDiskCache<'sess> {
// current compilation session, the crate is guaranteed to be the same
// (otherwise, we would compute a different `DefPathHash`).
let raw_def_id = self.get_raw_def_id(&hash)?;
debug!("def_path_hash_to_def_id({:?}): raw_def_id = {:?}", hash, raw_def_id);
// If the owning crate no longer exists, the corresponding definition definitely
// no longer exists.
let krate = self.try_remap_cnum(tcx, raw_def_id.krate)?;
debug!("def_path_hash_to_def_id({:?}): krate = {:?}", hash, krate);
// If our `DefPathHash` corresponded to a definition in the local crate,
// we should have either found it in `local_def_path_hash_to_def_id`, or
// never attempted to load it in the first place. Any query result or `DepNode`
Expand All @@ -621,6 +638,7 @@ impl<'sess> OnDiskCache<'sess> {
// Try to find a definition in the current session, using the previous `DefIndex`
// as an initial guess.
let opt_def_id = tcx.cstore.def_path_hash_to_def_id(krate, raw_def_id.index, hash);
debug!("def_path_to_def_id({:?}): opt_def_id = {:?}", hash, opt_def_id);
e.insert(opt_def_id);
opt_def_id
}
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_mir/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Rust MIR: a lowered representation of Rust.
#![feature(or_patterns)]
#![feature(once_cell)]
#![feature(control_flow_enum)]
#![feature(str_split_once)]
#![recursion_limit = "256"]

#[macro_use]
Expand Down
62 changes: 34 additions & 28 deletions compiler/rustc_mir/src/transform/coverage/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,40 +148,46 @@ impl DebugOptions {

if let Ok(env_debug_options) = std::env::var(RUSTC_COVERAGE_DEBUG_OPTIONS) {
for setting_str in env_debug_options.replace(" ", "").replace("-", "_").split(',') {
let mut setting = setting_str.splitn(2, '=');
match setting.next() {
Some(option) if option == "allow_unused_expressions" => {
allow_unused_expressions = bool_option_val(option, setting.next());
let (option, value) = match setting_str.split_once('=') {
None => (setting_str, None),
Some((k, v)) => (k, Some(v)),
};
match option {
"allow_unused_expressions" => {
allow_unused_expressions = bool_option_val(option, value);
debug!(
"{} env option `allow_unused_expressions` is set to {}",
RUSTC_COVERAGE_DEBUG_OPTIONS, allow_unused_expressions
);
}
Some(option) if option == "counter_format" => {
if let Some(strval) = setting.next() {
counter_format = counter_format_option_val(strval);
debug!(
"{} env option `counter_format` is set to {:?}",
RUSTC_COVERAGE_DEBUG_OPTIONS, counter_format
);
} else {
bug!(
"`{}` option in environment variable {} requires one or more \
plus-separated choices (a non-empty subset of \
`id+block+operation`)",
option,
RUSTC_COVERAGE_DEBUG_OPTIONS
);
}
"counter_format" => {
match value {
None => {
bug!(
"`{}` option in environment variable {} requires one or more \
plus-separated choices (a non-empty subset of \
`id+block+operation`)",
option,
RUSTC_COVERAGE_DEBUG_OPTIONS
);
}
Some(val) => {
counter_format = counter_format_option_val(val);
debug!(
"{} env option `counter_format` is set to {:?}",
RUSTC_COVERAGE_DEBUG_OPTIONS, counter_format
);
}
};
}
Some("") => {}
Some(invalid) => bug!(
"Unsupported setting `{}` in environment variable {}",
invalid,
RUSTC_COVERAGE_DEBUG_OPTIONS
),
None => {}
}
_ => {
bug!(
"Unsupported setting `{}` in environment variable {}",
option,
RUSTC_COVERAGE_DEBUG_OPTIONS
)
}
};
}
}

Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_query_system/src/dep_graph/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,9 +596,9 @@ impl<K: DepKind> DepGraph<K> {
// an eval_always node, let's try to mark it green recursively.
if !dep_dep_node.kind.is_eval_always() {
debug!(
"try_mark_previous_green({:?}) --- state of dependency {:?} \
"try_mark_previous_green({:?}) --- state of dependency {:?} ({}) \
is unknown, trying to mark it green",
dep_node, dep_dep_node
dep_node, dep_dep_node, dep_dep_node.hash,
);

let node_index = self.try_mark_previous_green(
Expand Down
Loading