about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-05-07 04:15:52 +0000
committerbors <bors@rust-lang.org>2022-05-07 04:15:52 +0000
commit36aa7c143672af30bfcca01e5924b326f93fd922 (patch)
tree4f0f09cb15aa4b22eba2831f837f6c1764630626 /src
parentf6e5570460b2bb925021dc667ead2a9834ea88cb (diff)
parentfe526695d1b274921e6df2b13e19035bb9a46742 (diff)
downloadrust-36aa7c143672af30bfcca01e5924b326f93fd922.tar.gz
rust-36aa7c143672af30bfcca01e5924b326f93fd922.zip
Auto merge of #96804 - compiler-errors:rollup-1mc6aw3, r=compiler-errors
Rollup of 8 pull requests

Successful merges:

 - #96660 ([bootstrap] Give a better error when trying to run a path with no registered step)
 - #96701 (update `jemallocator` example to use 2018 edition import syntax)
 - #96746 (Fix an ICE on #96738)
 - #96758 (bootstrap: bsd platform flags for split debuginfo)
 - #96778 (Remove closures on `expect_local` to apply `#[track_caller]`)
 - #96781 (Fix an incorrect link in The Unstable Book)
 - #96783 (Link to correct issue in issue-95034 known-bug)
 - #96801 (Add regression test for #96319)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/builder.rs22
-rw-r--r--src/doc/unstable-book/src/language-features/plugin.md2
-rw-r--r--src/test/incremental/issue-96319-coinductive-cycle.rs34
-rw-r--r--src/test/ui/hrtb/issue-95034.rs (renamed from src/test/ui/hrtb/issue-94034.rs)2
-rw-r--r--src/test/ui/hrtb/issue-95034.stderr (renamed from src/test/ui/hrtb/issue-94034.stderr)0
-rw-r--r--src/test/ui/typeck/issue-96738.rs3
-rw-r--r--src/test/ui/typeck/issue-96738.stderr16
7 files changed, 75 insertions, 4 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index 2224bf5f66e..fe60c6da92b 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -284,7 +284,19 @@ impl StepDescription {
             }
 
             if !attempted_run {
-                panic!("error: no rules matched {}", path.display());
+                eprintln!(
+                    "error: no `{}` rules matched '{}'",
+                    builder.kind.as_str(),
+                    path.display()
+                );
+                eprintln!(
+                    "help: run `x.py {} --help --verbose` to show a list of available paths",
+                    builder.kind.as_str()
+                );
+                eprintln!(
+                    "note: if you are adding a new Step to bootstrap itself, make sure you register it with `describe!`"
+                );
+                std::process::exit(1);
             }
         }
     }
@@ -1405,8 +1417,12 @@ impl<'a> Builder<'a> {
         // FIXME(davidtwco): #[cfg(not(bootstrap))] - #95612 needs to be in the bootstrap compiler
         // for this conditional to be removed.
         if !target.contains("windows") || compiler.stage >= 1 {
-            if target.contains("linux") || target.contains("windows") || target.contains("openbsd")
-            {
+            let needs_unstable_opts = target.contains("linux")
+                || target.contains("windows")
+                || target.contains("bsd")
+                || target.contains("dragonfly");
+
+            if needs_unstable_opts {
                 rustflags.arg("-Zunstable-options");
             }
             match self.config.rust_split_debuginfo {
diff --git a/src/doc/unstable-book/src/language-features/plugin.md b/src/doc/unstable-book/src/language-features/plugin.md
index 040f46f8b7c..56fe9a31bfe 100644
--- a/src/doc/unstable-book/src/language-features/plugin.md
+++ b/src/doc/unstable-book/src/language-features/plugin.md
@@ -102,7 +102,7 @@ The components of a lint plugin are:
 
 Lint passes are syntax traversals, but they run at a late stage of compilation
 where type information is available. `rustc`'s [built-in
-lints](https://github.com/rust-lang/rust/blob/master/src/librustc_session/lint/builtin.rs)
+lints](https://github.com/rust-lang/rust/blob/master/compiler/rustc_lint_defs/src/builtin.rs)
 mostly use the same infrastructure as lint plugins, and provide examples of how
 to access type information.
 
diff --git a/src/test/incremental/issue-96319-coinductive-cycle.rs b/src/test/incremental/issue-96319-coinductive-cycle.rs
new file mode 100644
index 00000000000..b5ff9112a20
--- /dev/null
+++ b/src/test/incremental/issue-96319-coinductive-cycle.rs
@@ -0,0 +1,34 @@
+// edition:2018
+// revisions: rpass1 rpass2
+
+pub struct Stmt {
+    pub stmt_type: StmtKind,
+    #[cfg(rpass1)] pub stmt_tag: Option<LintTag>,
+    #[cfg(rpass2)] pub renamed_tag: Option<LintTag>,
+}
+pub struct LintTag;
+pub enum StmtKind {
+    If(If),
+    Block(&'static str),
+    Return(Return),
+}
+pub struct If {
+    pub condition: Function,
+}
+pub struct Return {
+    pub value: Function,
+}
+pub struct Function {
+    pub parameters: Box<Stmt>,
+}
+pub fn start_late_pass(stmt_receiver: Box<Stmt>) {
+    spawn(async { stmt_receiver });
+}
+
+pub fn spawn<T>(_: T)
+where
+    T: Send,
+{
+}
+
+fn main() {}
diff --git a/src/test/ui/hrtb/issue-94034.rs b/src/test/ui/hrtb/issue-95034.rs
index 5239e5db11c..aee6fe61ba8 100644
--- a/src/test/ui/hrtb/issue-94034.rs
+++ b/src/test/ui/hrtb/issue-95034.rs
@@ -17,6 +17,8 @@
 
 // This should not ICE.
 
+// Refer to the issue for more minimized versions.
+
 use std::{
     future::Future,
     marker::PhantomData,
diff --git a/src/test/ui/hrtb/issue-94034.stderr b/src/test/ui/hrtb/issue-95034.stderr
index 1d8329142fc..1d8329142fc 100644
--- a/src/test/ui/hrtb/issue-94034.stderr
+++ b/src/test/ui/hrtb/issue-95034.stderr
diff --git a/src/test/ui/typeck/issue-96738.rs b/src/test/ui/typeck/issue-96738.rs
new file mode 100644
index 00000000000..7f1d1428eb9
--- /dev/null
+++ b/src/test/ui/typeck/issue-96738.rs
@@ -0,0 +1,3 @@
+fn main() {
+    Some.nonexistent_method(); //~ ERROR: no method named `nonexistent_method` found
+}
diff --git a/src/test/ui/typeck/issue-96738.stderr b/src/test/ui/typeck/issue-96738.stderr
new file mode 100644
index 00000000000..58c83a36a3b
--- /dev/null
+++ b/src/test/ui/typeck/issue-96738.stderr
@@ -0,0 +1,16 @@
+error[E0599]: no method named `nonexistent_method` found for fn item `fn(_) -> Option<_> {Option::<_>::Some}` in the current scope
+  --> $DIR/issue-96738.rs:2:10
+   |
+LL |     Some.nonexistent_method();
+   |     ---- ^^^^^^^^^^^^^^^^^^ method not found in `fn(_) -> Option<_> {Option::<_>::Some}`
+   |     |
+   |     this is the constructor of an enum variant
+   |
+help: call the constructor
+   |
+LL |     (Some)(_).nonexistent_method();
+   |     +    ++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0599`.