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 10 pull requests #76502

Merged
merged 21 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
08e3515
rustc_expand: remove pub visibility for rustfmt
calebcartwright Sep 5, 2020
d80415a
Improve ayu doc source line number contrast
pickfire Sep 5, 2020
4fff14d
rustbuild: Remove `Mode::Codegen`
petrochenkov Sep 5, 2020
5acd272
Fix HashMap visualizers in Visual Studio (Code)
MaulingMonkey Sep 5, 2020
b92b0d6
Fix typo in tracking issue template
dylni Sep 6, 2020
9e14033
Update linker-plugin-lto.md to contain up to rust 1.46
elichai Sep 6, 2020
84fc6fd
Fix documentation for TyCtxt::all_impls
scrabsha Sep 6, 2020
2e82589
linker-plugin-lto.md: Convert the rust-clang MxN table to a 2xM table
elichai Sep 6, 2020
ee55c1f
Add regression test and help note
JulianKnodt Sep 6, 2020
98231bf
Make duration_since documentation more clear
Aug 31, 2020
8b2106f
Update cargo
ehuss Sep 8, 2020
87302a2
Rollup merge of #76162 - abrausch:documentation-fix-duration_since, r…
Dylan-DPC Sep 8, 2020
4ac88c0
Rollup merge of #76355 - calebcartwright:reduce-rustfmt-visibility, r…
Dylan-DPC Sep 8, 2020
3cec71e
Rollup merge of #76374 - pickfire:patch-4, r=Cldfire
Dylan-DPC Sep 8, 2020
b2ca513
Rollup merge of #76379 - petrochenkov:nodegen, r=Mark-Simulacrum
Dylan-DPC Sep 8, 2020
222b885
Rollup merge of #76389 - MaulingMonkey:pr-natvis-hashmap-vsc, r=petro…
Dylan-DPC Sep 8, 2020
d45faff
Rollup merge of #76396 - dylni:fix-typo-in-tracking-issue-template, r…
Dylan-DPC Sep 8, 2020
1083833
Rollup merge of #76401 - JulianKnodt:i68366, r=lcnr
Dylan-DPC Sep 8, 2020
1aef86c
Rollup merge of #76402 - elichai:patch-2, r=wesleywiser
Dylan-DPC Sep 8, 2020
1270734
Rollup merge of #76403 - scileo:doc-all-impls, r=lcnr
Dylan-DPC Sep 8, 2020
389321a
Rollup merge of #76498 - ehuss:update-cargo, r=ehuss
Dylan-DPC Sep 8, 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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/tracking_issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The feature gate for the issue is `#![feature(FFF)]`.
### About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also uses as hubs connecting to other relevant issues, e.g., bugs or open design questions.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however *not* meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.

Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_expand/src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,7 @@ fn error_cannot_declare_mod_here<'a, T>(

/// Derive a submodule path from the first found `#[path = "path_string"]`.
/// The provided `dir_path` is joined with the `path_string`.
// Public for rustfmt usage.
pub fn submod_path_from_attr(
pub(super) fn submod_path_from_attr(
sess: &Session,
attrs: &[Attribute],
dir_path: &Path,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/trait_def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ impl<'tcx> TyCtxt<'tcx> {
}
}

/// Returns a vector containing all impls
/// Returns an iterator containing all impls
pub fn all_impls(self, def_id: DefId) -> impl Iterator<Item = DefId> + 'tcx {
let TraitImpls { blanket_impls, non_blanket_impls } = self.trait_impls_of(def_id);

Expand Down
18 changes: 13 additions & 5 deletions compiler/rustc_typeck/src/impl_wf_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ fn enforce_impl_params_are_constrained(
}

// (*) This is a horrible concession to reality. I think it'd be
// better to just ban unconstrianed lifetimes outright, but in
// better to just ban unconstrained lifetimes outright, but in
// practice people do non-hygenic macros like:
//
// ```
Expand All @@ -207,17 +207,25 @@ fn enforce_impl_params_are_constrained(
}

fn report_unused_parameter(tcx: TyCtxt<'_>, span: Span, kind: &str, name: &str) {
struct_span_err!(
let mut err = struct_span_err!(
tcx.sess,
span,
E0207,
"the {} parameter `{}` is not constrained by the \
impl trait, self type, or predicates",
kind,
name
)
.span_label(span, format!("unconstrained {} parameter", kind))
.emit();
);
err.span_label(span, format!("unconstrained {} parameter", kind));
if kind == "const" {
err.note(
"expressions using a const parameter must map each value to a distinct output value",
);
err.note(
"proving the result of expressions other than the parameter are unique is not supported",
);
}
err.emit();
}

/// Enforce that we do not have two items in an impl with the same name.
Expand Down
7 changes: 4 additions & 3 deletions library/std/src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,12 +460,13 @@ impl SystemTime {
///
/// # Examples
///
/// ```
/// ```no_run
/// use std::time::SystemTime;
///
/// let sys_time = SystemTime::now();
/// let difference = sys_time.duration_since(sys_time)
/// .expect("Clock may have gone backwards");
/// let new_sys_time = SystemTime::now();
/// let difference = new_sys_time.duration_since(sys_time)
/// .expect("Clock may have gone backwards");
/// println!("{:?}", difference);
/// ```
#[stable(feature = "time2", since = "1.8.0")]
Expand Down
10 changes: 5 additions & 5 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ impl<'a> Builder<'a> {
if cmd == "doc" || cmd == "rustdoc" {
let my_out = match mode {
// This is the intended out directory for compiler documentation.
Mode::Rustc | Mode::ToolRustc | Mode::Codegen => self.compiler_doc_out(target),
Mode::Rustc | Mode::ToolRustc => self.compiler_doc_out(target),
Mode::Std => out_dir.join(target.triple).join("doc"),
_ => panic!("doc mode {:?} not expected", mode),
};
Expand Down Expand Up @@ -875,7 +875,7 @@ impl<'a> Builder<'a> {

match mode {
Mode::Std | Mode::ToolBootstrap | Mode::ToolStd => {}
Mode::Rustc | Mode::Codegen | Mode::ToolRustc => {
Mode::Rustc | Mode::ToolRustc => {
// Build proc macros both for the host and the target
if target != compiler.host && cmd != "check" {
cargo.arg("-Zdual-proc-macros");
Expand Down Expand Up @@ -1060,7 +1060,7 @@ impl<'a> Builder<'a> {
}

let debuginfo_level = match mode {
Mode::Rustc | Mode::Codegen => self.config.rust_debuginfo_level_rustc,
Mode::Rustc => self.config.rust_debuginfo_level_rustc,
Mode::Std => self.config.rust_debuginfo_level_std,
Mode::ToolBootstrap | Mode::ToolStd | Mode::ToolRustc => {
self.config.rust_debuginfo_level_tools
Expand Down Expand Up @@ -1197,7 +1197,7 @@ impl<'a> Builder<'a> {
rustdocflags.arg("-Winvalid_codeblock_attributes");
}

if let Mode::Rustc | Mode::Codegen = mode {
if mode == Mode::Rustc {
rustflags.arg("-Zunstable-options");
rustflags.arg("-Wrustc::internal");
}
Expand Down Expand Up @@ -1360,7 +1360,7 @@ impl<'a> Builder<'a> {
// When we build Rust dylibs they're all intended for intermediate
// usage, so make sure we pass the -Cprefer-dynamic flag instead of
// linking all deps statically into the dylib.
if let Mode::Std | Mode::Rustc | Mode::Codegen = mode {
if matches!(mode, Mode::Std | Mode::Rustc) {
rustflags.arg("-Cprefer-dynamic");
}

Expand Down
4 changes: 0 additions & 4 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,6 @@ pub enum Mode {
/// Build librustc, and compiler libraries, placing output in the "stageN-rustc" directory.
Rustc,

/// Build codegen libraries, placing output in the "stageN-codegen" directory
Codegen,

/// Build a tool, placing output in the "stage0-bootstrap-tools"
/// directory. This is for miscellaneous sets of tools that are built
/// using the bootstrap stage0 compiler in its entirety (target libraries
Expand Down Expand Up @@ -570,7 +567,6 @@ impl Build {
let suffix = match mode {
Mode::Std => "-std",
Mode::Rustc => "-rustc",
Mode::Codegen => "-codegen",
Mode::ToolBootstrap => "-bootstrap-tools",
Mode::ToolStd | Mode::ToolRustc => "-tools",
};
Expand Down
27 changes: 15 additions & 12 deletions src/doc/rustc/src/linker-plugin-lto.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,20 @@ LLVM. However, the approximation is usually reliable.

The following table shows known good combinations of toolchain versions.

| | Clang 7 | Clang 8 | Clang 9 |
|-----------|-----------|-----------|-----------|
| Rust 1.34 | ✗ | ✓ | ✗ |
| Rust 1.35 | ✗ | ✓ | ✗ |
| Rust 1.36 | ✗ | ✓ | ✗ |
| Rust 1.37 | ✗ | ✓ | ✗ |
| Rust 1.38 | ✗ | ✗ | ✓ |
| Rust 1.39 | ✗ | ✗ | ✓ |
| Rust 1.40 | ✗ | ✗ | ✓ |
| Rust 1.41 | ✗ | ✗ | ✓ |
| Rust 1.42 | ✗ | ✗ | ✓ |
| Rust 1.43 | ✗ | ✗ | ✓ |
| Rust Version | Clang Version |
|--------------|---------------|
| Rust 1.34 | Clang 8 |
| Rust 1.35 | Clang 8 |
| Rust 1.36 | Clang 8 |
| Rust 1.37 | Clang 8 |
| Rust 1.38 | Clang 9 |
| Rust 1.39 | Clang 9 |
| Rust 1.40 | Clang 9 |
| Rust 1.41 | Clang 9 |
| Rust 1.42 | Clang 9 |
| Rust 1.43 | Clang 9 |
| Rust 1.44 | Clang 9 |
| Rust 1.45 | Clang 10 |
| Rust 1.46 | Clang 10 |

Note that the compatibility policy for this feature might change in the future.
4 changes: 2 additions & 2 deletions src/etc/natvis/libstd.natvis
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<If Condition="(base.table.ctrl.pointer[i] &amp; 0x80) == 0">
<!-- Bucket is populated -->
<Exec>n--</Exec>
<Item Name="{static_cast&lt;tuple&lt;$T1, $T2&gt;*&gt;(base.table.ctrl.pointer)[-(i + 1)].__0}">static_cast&lt;tuple&lt;$T1, $T2&gt;*&gt;(base.table.ctrl.pointer)[-(i + 1)].__1</Item>
<Item Name="{((tuple&lt;$T1, $T2&gt;*)base.table.ctrl.pointer)[-(i + 1)].__0}">((tuple&lt;$T1, $T2&gt;*)base.table.ctrl.pointer)[-(i + 1)].__1</Item>
</If>
<Exec>i++</Exec>
</Loop>
Expand All @@ -65,7 +65,7 @@
<If Condition="(map.base.table.ctrl.pointer[i] &amp; 0x80) == 0">
<!-- Bucket is populated -->
<Exec>n--</Exec>
<Item>static_cast&lt;$T1*&gt;(map.base.table.ctrl.pointer)[-(i + 1)]</Item>
<Item>(($T1*)map.base.table.ctrl.pointer)[-(i + 1)]</Item>
</If>
<Exec>i++</Exec>
</Loop>
Expand Down
5 changes: 3 additions & 2 deletions src/librustdoc/html/static/themes/ayu.css
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,10 @@ pre {
color: #ffb44c;
}

.line-numbers span { color: #5c6773ab; }
.line-numbers span { color: #5c6773; }
.line-numbers .line-highlighted {
background-color: rgba(255, 236, 164, 0.06) !important;
color: #708090;
background-color: rgba(255, 236, 164, 0.06);
padding-right: 4px;
border-right: 1px solid #ffb44c;
}
Expand Down
18 changes: 18 additions & 0 deletions src/test/ui/const-generics/issues/issue-68366.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Checks that const expressions have a useful note explaining why they can't be evaluated.
// The note should relate to the fact that it cannot be shown forall N that it maps 1-1 to a new
// type.

#![feature(const_generics)]
#![allow(incomplete_features)]

struct Collatz<const N: Option<usize>>;

impl <const N: usize> Collatz<{Some(N)}> {}
//~^ ERROR the const parameter

struct Foo;

impl<const N: usize> Foo {}
//~^ ERROR the const parameter

fn main() {}
21 changes: 21 additions & 0 deletions src/test/ui/const-generics/issues/issue-68366.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates
--> $DIR/issue-68366.rs:10:13
|
LL | impl <const N: usize> Collatz<{Some(N)}> {}
| ^ unconstrained const parameter
|
= note: expressions using a const parameter must map each value to a distinct output value
= note: proving the result of expressions other than the parameter are unique is not supported

error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates
--> $DIR/issue-68366.rs:15:12
|
LL | impl<const N: usize> Foo {}
| ^ unconstrained const parameter
|
= note: expressions using a const parameter must map each value to a distinct output value
= note: proving the result of expressions other than the parameter are unique is not supported

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0207`.