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

Fix <unknown> queries and add more timing info to render_html #81275

Merged
merged 4 commits into from
Jan 24, 2021

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Jan 22, 2021

Closes #81251.

Fix <unknown> queries

This happened because alloc_query_strings was never called.

Add more timing info to render_html

This still has some issues I'm not sure how to work out:

  • create_renderer and renderer_after_krate aren't shown by default.
    I want something like verbose_generic_activity_with_arg, but it doesn't exist.

I'm also not sure how to show activities that aren't on by default - I
tried -Z self-profile -Z self-profile-args=all, but it didn't show up.

r? @wesleywiser

@jyn514 jyn514 added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. WG-compiler-performance Working group: Compiler Performance A-self-profile Area: Self-profiling feature of the compiler labels Jan 22, 2021
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 22, 2021
@jyn514
Copy link
Member Author

jyn514 commented Jan 22, 2021

Another idea I thought of - rather than making each tool call this on its own, it might be easier to add it to the drop impl of GlobalCtxt.

@rust-log-analyzer

This comment has been minimized.

@jyn514
Copy link
Member Author

jyn514 commented Jan 22, 2021

I think -Z self-profile-args might just be broken with rustdoc?

@jyn514
Copy link
Member Author

jyn514 commented Jan 22, 2021

Another idea I thought of - rather than making each tool call this on its own, it might be easier to add it to the drop impl of GlobalCtxt.

Hmm, for some reason this didn't work.

error: lifetime may not live long enough
    --> compiler/rustc_middle/src/ty/context.rs:1016:23
     |
1013 | impl<'tcx> Drop for GlobalCtxt<'tcx> {
     |      ---- lifetime `'tcx` defined here
1014 |     fn drop(&mut self) {
     |             - let's call the lifetime of this reference `'1`
1016 |         TyCtxt { gcx: self }.alloc_self_profile_query_strings();
     |                       ^^^^ requires that `'1` must outlive `'tcx`

@rust-log-analyzer

This comment has been minimized.

@jyn514
Copy link
Member Author

jyn514 commented Jan 22, 2021

I want something like verbose_generic_activity_with_arg, but it doesn't exist.

It turns out this is extra_verbose_generic_activity.

@jyn514
Copy link
Member Author

jyn514 commented Jan 22, 2021

Another idea I thought of - rather than making each tool call this on its own, it might be easier to add it to the drop impl of GlobalCtxt.

Ugh - so the modified version of this idea I came up with, add it to Compiler::enter instead, doesn't work because rustdoc steal()s the GlobalCtxt. When Compiler tries to calculate it again, it panics because rustdoc messed with the resolver:

time: 0.342; rss: 696MB	render_html
thread 'rustc' panicked at 'attempt to steal from stolen value', compiler/rustc_interface/src/queries.rs:265:34
stack backtrace:
   0: rust_begin_unwind
             at /home/joshua/rustc3/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /home/joshua/rustc3/library/core/src/panicking.rs:92:14
   2: core::option::expect_failed
             at /home/joshua/rustc3/library/core/src/option.rs:1258:5
   3: core::option::Option<T>::expect
             at /home/joshua/rustc3/library/core/src/option.rs:349:21
   4: rustc_data_structures::steal::Steal<T>::steal
             at /home/joshua/rustc3/compiler/rustc_data_structures/src/steal.rs:45:9
   5: rustc_interface::queries::Queries::global_ctxt::{{closure}}
             at /home/joshua/rustc3/compiler/rustc_interface/src/queries.rs:265:17
   6: rustc_interface::queries::Query<T>::compute
             at /home/joshua/rustc3/compiler/rustc_interface/src/queries.rs:39:28
   7: rustc_interface::queries::Queries::global_ctxt
             at /home/joshua/rustc3/compiler/rustc_interface/src/queries.rs:252:9
   8: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
             at /home/joshua/rustc3/compiler/rustc_interface/src/queries.rs:420:26
   9: rustdoc::main_options::{{closure}}
             at /home/joshua/rustc3/src/librustdoc/lib.rs:530:9
  10: rustc_interface::interface::create_compiler_and_run::{{closure}}
             at /home/joshua/rustc3/compiler/rustc_interface/src/interface.rs:197:13
  11: rustc_span::with_source_map
             at /home/joshua/rustc3/compiler/rustc_span/src/lib.rs:787:5
  12: rustc_interface::interface::create_compiler_and_run
             at /home/joshua/rustc3/compiler/rustc_interface/src/interface.rs:191:5
  13: rustdoc::main_options
             at /home/joshua/rustc3/src/librustdoc/lib.rs:529:5
  14: rustdoc::main_args::{{closure}}
             at /home/joshua/rustc3/src/librustdoc/lib.rs:454:17
  15: rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals::{{closure}}::{{closure}}
             at /home/joshua/rustc3/compiler/rustc_interface/src/util.rs:152:13
  16: scoped_tls::ScopedKey<T>::set
             at /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137:9
  17: rustc_span::with_session_globals
             at /home/joshua/rustc3/compiler/rustc_span/src/lib.rs:103:5
  18: rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals::{{closure}}
             at /home/joshua/rustc3/compiler/rustc_interface/src/util.rs:150:9
  19: rustc_interface::util::scoped_thread::{{closure}}
             at /home/joshua/rustc3/compiler/rustc_interface/src/util.rs:125:24
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

error: Unrecognized option: 'crate-version'

time: 0.076; rss: 840MB	create_global_ctxt

For now I reverted the change and just had rustdoc call it manually. I was playing with adding it to impl Drop for QueryContext, but I couldn't get the lifetimes to work.

@rust-log-analyzer

This comment has been minimized.

@jyn514 jyn514 force-pushed the time-render branch 2 times, most recently from e697a60 to 1e7c4f3 Compare January 22, 2021 18:48
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-9 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
.................................................................................................... 3400/11277
.................................................................................................... 3500/11277
.................................................................................................... 3600/11277
.................................................................................................... 3700/11277
..............................F.F................................................................... 3800/11277
............................................................................................F....... 4000/11277
.................................................................................................... 4100/11277
.................................................................................................... 4200/11277
...............ii..................................................................................i 4300/11277
---
normalized stderr:
error[E0433]: failed to resolve: use of undeclared type `Foo`
  --> $DIR/in-trait-impl.rs:7:27
   |
LL |     type Quux<'a> = <T as Foo>::Bar<'a, 'static>;
   |                           ^^^ use of undeclared type `Foo`

error[E0405]: cannot find trait `Baz` in this scope
  --> $DIR/in-trait-impl.rs:6:9
   |
LL | impl<T> Baz for T where T: Foo {

error[E0405]: cannot find trait `Foo` in this scope
  --> $DIR/in-trait-impl.rs:6:28
   |
   |
LL | impl<T> Baz for T where T: Foo {


warning: the feature `generic_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes
  --> $DIR/in-trait-impl.rs:4:12
LL | #![feature(generic_associated_types)]
   |            ^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(incomplete_features)]` on by default
---



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/generic-associated-types/parse/in-trait-impl/in-trait-impl.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args generic-associated-types/parse/in-trait-impl.rs`
error: 1 errors occurred comparing output.
status: exit code: 0
status: exit code: 0
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/generic-associated-types/parse/in-trait-impl.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zemit-future-incompat-report" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/generic-associated-types/parse/in-trait-impl" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Z" "parse-only" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/generic-associated-types/parse/in-trait-impl/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error[E0433]: failed to resolve: use of undeclared type `Foo`
  --> /checkout/src/test/ui/generic-associated-types/parse/in-trait-impl.rs:7:27
   |
LL |     type Quux<'a> = <T as Foo>::Bar<'a, 'static>;
   |                           ^^^ use of undeclared type `Foo`

error[E0405]: cannot find trait `Baz` in this scope
Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
   |
   |
LL | impl<T> Baz for T where T: Foo {

error[E0405]: cannot find trait `Foo` in this scope
  --> /checkout/src/test/ui/generic-associated-types/parse/in-trait-impl.rs:6:28
   |
   |
LL | impl<T> Baz for T where T: Foo {


warning: the feature `generic_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes
   |
LL | #![feature(generic_associated_types)]
   |            ^^^^^^^^^^^^^^^^^^^^^^^^
   |
---


---- [ui] ui/generic-associated-types/parse/in-trait.rs stdout ----
normalized stderr:
error[E0428]: the name `Bar` is defined multiple times
  --> $DIR/in-trait.rs:11:5
   |
LL |     type Bar<'a>;
   |     ------------- previous definition of the type `Bar` here
LL |     type Bar<'a, 'b>;
   |     ^^^^^^^^^^^^^^^^^ `Bar` redefined here
   |
   = note: `Bar` must be defined only once in the type namespace of this trait

error[E0428]: the name `Bar` is defined multiple times
  --> $DIR/in-trait.rs:12:5
   |
LL |     type Bar<'a>;
   |     ------------- previous definition of the type `Bar` here
LL |     type Bar<'a, 'b>;
LL |     type Bar<'a, 'b,>;
   |     ^^^^^^^^^^^^^^^^^^ `Bar` redefined here
   |
   = note: `Bar` must be defined only once in the type namespace of this trait

error[E0428]: the name `Bar` is defined multiple times
  --> $DIR/in-trait.rs:13:5
   |
LL |     type Bar<'a>;
   |     ------------- previous definition of the type `Bar` here
...
LL |     type Bar<'a, 'b, T>;
   |     ^^^^^^^^^^^^^^^^^^^^ `Bar` redefined here
   |
   = note: `Bar` must be defined only once in the type namespace of this trait

error[E0428]: the name `Bar` is defined multiple times
  --> $DIR/in-trait.rs:14:5
   |
LL |     type Bar<'a>;
   |     ------------- previous definition of the type `Bar` here
...
LL |     type Bar<'a, 'b, T, U>;
   |     ^^^^^^^^^^^^^^^^^^^^^^^ `Bar` redefined here
   |
   = note: `Bar` must be defined only once in the type namespace of this trait

error[E0428]: the name `Bar` is defined multiple times
  --> $DIR/in-trait.rs:15:5
   |
LL |     type Bar<'a>;
   |     ------------- previous definition of the type `Bar` here
...
LL |     type Bar<'a, 'b, T, U,>;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^ `Bar` redefined here
   |
   = note: `Bar` must be defined only once in the type namespace of this trait

error[E0428]: the name `Bar` is defined multiple times
  --> $DIR/in-trait.rs:16:5
   |
LL |     type Bar<'a>;
   |     ------------- previous definition of the type `Bar` here
...
LL |     type Bar<'a, 'b, T: Debug, U,>;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Bar` redefined here
   |
   = note: `Bar` must be defined only once in the type namespace of this trait

error[E0428]: the name `Bar` is defined multiple times
  --> $DIR/in-trait.rs:17:5
   |
LL |     type Bar<'a>;
   |     ------------- previous definition of the type `Bar` here
...
LL |     type Bar<'a, 'b, T: Debug, U,>: Debug;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Bar` redefined here
   |
   = note: `Bar` must be defined only once in the type namespace of this trait

error[E0428]: the name `Bar` is defined multiple times
  --> $DIR/in-trait.rs:18:5
   |
LL |     type Bar<'a>;
   |     ------------- previous definition of the type `Bar` here
...
LL |     type Bar<'a, 'b, T: Debug, U,>: Deref<Target = T> + Into<U>;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Bar` redefined here
   |
   = note: `Bar` must be defined only once in the type namespace of this trait

error[E0428]: the name `Bar` is defined multiple times
  --> $DIR/in-trait.rs:19:5
   |
LL |     type Bar<'a>;
   |     ------------- previous definition of the type `Bar` here
...
LL |     type Bar<'a, 'b, T: Debug, U,> where T: Deref<Target = U>, U: Into<T>;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Bar` redefined here
   |
   = note: `Bar` must be defined only once in the type namespace of this trait

error[E0428]: the name `Bar` is defined multiple times
  --> $DIR/in-trait.rs:20:5
   |
LL |       type Bar<'a>;
   |       ------------- previous definition of the type `Bar` here
...
LL | /     type Bar<'a, 'b, T: Debug, U,>: Deref<Target = T> + Into<U>
LL | |         where T: Deref<Target = U>, U: Into<T>;
   | |_______________________________________________^ `Bar` redefined here
   |
   = note: `Bar` must be defined only once in the type namespace of this trait

warning: the feature `generic_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes
  --> $DIR/in-trait.rs:4:12
LL | #![feature(generic_associated_types)]
   |            ^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(incomplete_features)]` on by default
---



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/generic-associated-types/parse/in-trait/in-trait.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args generic-associated-types/parse/in-trait.rs`
error: 1 errors occurred comparing output.
status: exit code: 0
status: exit code: 0
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/generic-associated-types/parse/in-trait.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zemit-future-incompat-report" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/generic-associated-types/parse/in-trait" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Z" "parse-only" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/generic-associated-types/parse/in-trait/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error[E0428]: the name `Bar` is defined multiple times
   |
   |
LL |     type Bar<'a>;
   |     ------------- previous definition of the type `Bar` here
LL |     type Bar<'a, 'b>;
   |     ^^^^^^^^^^^^^^^^^ `Bar` redefined here
   |
   = note: `Bar` must be defined only once in the type namespace of this trait

error[E0428]: the name `Bar` is defined multiple times
   |
   |
LL |     type Bar<'a>;
   |     ------------- previous definition of the type `Bar` here
LL |     type Bar<'a, 'b>;
LL |     type Bar<'a, 'b,>;
   |     ^^^^^^^^^^^^^^^^^^ `Bar` redefined here
   |
   = note: `Bar` must be defined only once in the type namespace of this trait

error[E0428]: the name `Bar` is defined multiple times
   |
   |
LL |     type Bar<'a>;
   |     ------------- previous definition of the type `Bar` here
...
LL |     type Bar<'a, 'b, T>;
   |     ^^^^^^^^^^^^^^^^^^^^ `Bar` redefined here
   |
   = note: `Bar` must be defined only once in the type namespace of this trait

error[E0428]: the name `Bar` is defined multiple times
   |
   |
LL |     type Bar<'a>;
   |     ------------- previous definition of the type `Bar` here
...
LL |     type Bar<'a, 'b, T, U>;
   |     ^^^^^^^^^^^^^^^^^^^^^^^ `Bar` redefined here
   |
   = note: `Bar` must be defined only once in the type namespace of this trait

error[E0428]: the name `Bar` is defined multiple times
   |
   |
LL |     type Bar<'a>;
   |     ------------- previous definition of the type `Bar` here
...
LL |     type Bar<'a, 'b, T, U,>;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^ `Bar` redefined here
   |
   = note: `Bar` must be defined only once in the type namespace of this trait

error[E0428]: the name `Bar` is defined multiple times
   |
   |
LL |     type Bar<'a>;
   |     ------------- previous definition of the type `Bar` here
...
LL |     type Bar<'a, 'b, T: Debug, U,>;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Bar` redefined here
   |
   = note: `Bar` must be defined only once in the type namespace of this trait

error[E0428]: the name `Bar` is defined multiple times
   |
   |
LL |     type Bar<'a>;
   |     ------------- previous definition of the type `Bar` here
...
LL |     type Bar<'a, 'b, T: Debug, U,>: Debug;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Bar` redefined here
   |
   = note: `Bar` must be defined only once in the type namespace of this trait

error[E0428]: the name `Bar` is defined multiple times
   |
   |
LL |     type Bar<'a>;
   |     ------------- previous definition of the type `Bar` here
...
LL |     type Bar<'a, 'b, T: Debug, U,>: Deref<Target = T> + Into<U>;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Bar` redefined here
   |
   = note: `Bar` must be defined only once in the type namespace of this trait

error[E0428]: the name `Bar` is defined multiple times
   |
   |
LL |     type Bar<'a>;
   |     ------------- previous definition of the type `Bar` here
...
LL |     type Bar<'a, 'b, T: Debug, U,> where T: Deref<Target = U>, U: Into<T>;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Bar` redefined here
   |
   = note: `Bar` must be defined only once in the type namespace of this trait

error[E0428]: the name `Bar` is defined multiple times
   |
   |
LL |       type Bar<'a>;
   |       ------------- previous definition of the type `Bar` here
...
LL | /     type Bar<'a, 'b, T: Debug, U,>: Deref<Target = T> + Into<U>
LL | |         where T: Deref<Target = U>, U: Into<T>;
   | |_______________________________________________^ `Bar` redefined here
   |
   = note: `Bar` must be defined only once in the type namespace of this trait

warning: the feature `generic_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes
   |
LL | #![feature(generic_associated_types)]
   |            ^^^^^^^^^^^^^^^^^^^^^^^^
   |
---

---- [ui] ui/impl-trait/impl-trait-plus-priority.rs stdout ----
diff of stderr:

64 LL | type A = &A + B;
65    |          ^^^^^^ help: try adding parentheses: `&(A + B)`
- error: aborting due to 11 previous errors
- error: aborting due to 11 previous errors
+ error[E0428]: the name `f` is defined multiple times
+    |
+    |
+ LL | fn f() -> impl A + {} // OK
+    | ------------------ previous definition of the value `f` here
+ LL | fn f() -> impl A + B {} // OK
+    | ^^^^^^^^^^^^^^^^^^^^ `f` redefined here
+    |
+    = note: `f` must be defined only once in the value namespace of this module
- For more information about this error, try `rustc --explain E0178`.
- For more information about this error, try `rustc --explain E0178`.
+ error[E0428]: the name `f` is defined multiple times
+    |
+    |
+ LL | fn f() -> impl A + {} // OK
+    | ------------------ previous definition of the value `f` here
+ LL | fn f() -> impl A + B {} // OK
+ LL | fn f() -> dyn A + B {} // OK
+    | ^^^^^^^^^^^^^^^^^^^ `f` redefined here
+    |
+    = note: `f` must be defined only once in the value namespace of this module
+ 
+ error[E0428]: the name `f` is defined multiple times
+    |
+    |
+ LL | fn f() -> impl A + {} // OK
+    | ------------------ previous definition of the value `f` here
+ ...
+ LL | fn f() -> A + B {} // OK
+    | ^^^^^^^^^^^^^^^ `f` redefined here
+    |
+    = note: `f` must be defined only once in the value namespace of this module
+ 
+ error[E0428]: the name `A` is defined multiple times
+    |
+    |
+ LL | type A = fn() -> impl A +;
+    | -------------------------- previous definition of the type `A` here
+ LL |
+ LL | type A = fn() -> impl A + B;
+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `A` redefined here
+    |
+    = note: `A` must be defined only once in the type namespace of this module
+ 
+ error[E0428]: the name `A` is defined multiple times
+    |
+    |
+ LL | type A = fn() -> impl A +;
+    | -------------------------- previous definition of the type `A` here
+ ...
+ LL | type A = fn() -> dyn A + B;
+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `A` redefined here
+    |
+    = note: `A` must be defined only once in the type namespace of this module
+ 
+ error[E0428]: the name `A` is defined multiple times
+    |
+    |
+ LL | type A = fn() -> impl A +;
+    | -------------------------- previous definition of the type `A` here
+ ...
+ LL | type A = fn() -> A + B;
+    | ^^^^^^^^^^^^^^^^^^^^^^^ `A` redefined here
+    |
+    = note: `A` must be defined only once in the type namespace of this module
+ 
+ error[E0428]: the name `A` is defined multiple times
+    |
+    |
+ LL | type A = fn() -> impl A +;
+    | -------------------------- previous definition of the type `A` here
+ ...
+ LL | type A = Fn() -> impl A +;
+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^ `A` redefined here
+    |
+    = note: `A` must be defined only once in the type namespace of this module
+ 
+ error[E0428]: the name `A` is defined multiple times
+    |
+    |
+ LL | type A = fn() -> impl A +;
+    | -------------------------- previous definition of the type `A` here
+ ...
+ LL | type A = Fn() -> impl A + B;
+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `A` redefined here
+    |
+    = note: `A` must be defined only once in the type namespace of this module
+ 
+ error[E0428]: the name `A` is defined multiple times
+    |
+    |
+ LL | type A = fn() -> impl A +;
+    | -------------------------- previous definition of the type `A` here
+ ...
+ LL | type A = Fn() -> dyn A + B;
+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `A` redefined here
+    |
+    = note: `A` must be defined only once in the type namespace of this module
+ 
+ error[E0428]: the name `A` is defined multiple times
+    |
+    |
+ LL | type A = fn() -> impl A +;
+    | -------------------------- previous definition of the type `A` here
+ ...
+ LL | type A = Fn() -> A + B; // OK, interpreted as `(Fn() -> A) + B` for compatibility
+    | ^^^^^^^^^^^^^^^^^^^^^^^ `A` redefined here
+    |
+    = note: `A` must be defined only once in the type namespace of this module
+ 
+ error[E0428]: the name `A` is defined multiple times
+    |
+    |
+ LL | type A = fn() -> impl A +;
+    | -------------------------- previous definition of the type `A` here
+ ...
+ LL | type A = &impl A +;
+    | ^^^^^^^^^^^^^^^^^^^ `A` redefined here
+    |
+    = note: `A` must be defined only once in the type namespace of this module
+ 
+ error[E0428]: the name `A` is defined multiple times
+    |
+    |
+ LL | type A = fn() -> impl A +;
+    | -------------------------- previous definition of the type `A` here
+ ...
+ LL | type A = &impl A + B;
+    | ^^^^^^^^^^^^^^^^^^^^^ `A` redefined here
+    |
+    = note: `A` must be defined only once in the type namespace of this module
+ 
+ error[E0428]: the name `A` is defined multiple times
+    |
+    |
+ LL | type A = fn() -> impl A +;
+    | -------------------------- previous definition of the type `A` here
+ ...
+ LL | type A = &dyn A + B;
+    | ^^^^^^^^^^^^^^^^^^^^ `A` redefined here
+    |
+    = note: `A` must be defined only once in the type namespace of this module
+ 
+ error[E0428]: the name `A` is defined multiple times
+    |
+    |
+ LL | type A = fn() -> impl A +;
+    | -------------------------- previous definition of the type `A` here
+ ...
+ LL | type A = &A + B;
+    | ^^^^^^^^^^^^^^^^ `A` redefined here
+    |
+    = note: `A` must be defined only once in the type namespace of this module
+ 
+ error[E0404]: expected trait, found type alias `A`
+    |
+    |
+ LL | fn f() -> impl A + {} // OK
+    |                ^ type aliases cannot be used as traits
+    |
+ help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+    |
+    |
+ LL | type A = fn() -> impl A +;
+ 
+ 
+ error[E0404]: expected trait, found type alias `A`
+    |
+    |
+ LL | fn f() -> impl A + B {} // OK
+    |                ^ type aliases cannot be used as traits
+    |
+ help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+    |
+    |
+ LL | type A = fn() -> impl A +;
+ 
+ 
+ error[E0405]: cannot find trait `B` in this scope
+    |
+    |
+ LL | fn f() -> impl A + B {} // OK
+    |     -              ^ not found in this scope
+    |     help: you might be missing a type parameter: `<B>`
+ 
+ 
+ error[E0404]: expected trait, found type alias `A`
+    |
+    |
+ LL | fn f() -> dyn A + B {} // OK
+    |               ^ type aliases cannot be used as traits
+    |
+ help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+    |
+    |
+ LL | type A = fn() -> impl A +;
+ 
+ 
+ error[E0405]: cannot find trait `B` in this scope
+    |
+    |
+ LL | fn f() -> dyn A + B {} // OK
+    |     -             ^ not found in this scope
+    |     help: you might be missing a type parameter: `<B>`
+ 
+ 
+ error[E0404]: expected trait, found type alias `A`
+    |
+    |
+ LL | fn f() -> A + B {} // OK
+    |           ^ type aliases cannot be used as traits
+    |
+ help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+    |
+    |
+ LL | type A = fn() -> impl A +;
+ 
+ 
+ error[E0405]: cannot find trait `B` in this scope
+    |
+    |
+ LL | fn f() -> A + B {} // OK
+    |     -         ^ not found in this scope
+    |     help: you might be missing a type parameter: `<B>`
+ 
+ error[E0412]: cannot find type `S` in this scope
+   --> $DIR/impl-trait-plus-priority.rs:8:6
+   --> $DIR/impl-trait-plus-priority.rs:8:6
+    |
+ LL | impl S {
+    |      ^ help: a type alias with a similar name exists: `A`
+ ...
+ LL | type A = fn() -> impl A +;
+    | -------------------------- similarly named type alias `A` defined here
+ 
+ error[E0404]: expected trait, found type alias `A`
+    |
+    |
+ LL |     fn f(self) -> impl A + { // OK
+    |                        ^ type aliases cannot be used as traits
+    |
+ help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+    |
+    |
+ LL | type A = fn() -> impl A +;
+ 
+ 
+ error[E0404]: expected trait, found type alias `A`
+    |
+    |
+ LL |         let _ = |a, b| -> impl A + {}; // OK
+    |                                ^ type aliases cannot be used as traits
+    |
+ help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+    |
+    |
+ LL | type A = fn() -> impl A +;
+ 
+ 
+ error[E0404]: expected trait, found type alias `A`
+    |
+    |
+ LL |     fn f(self) -> impl A + B { // OK
+    |                        ^ type aliases cannot be used as traits
+    |
+ help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+    |
+    |
+ LL | type A = fn() -> impl A +;
+ 
+ 
+ error[E0405]: cannot find trait `B` in this scope
+    |
+    |
+ LL |     fn f(self) -> impl A + B { // OK
+    |                            ^ not found in this scope
+ 
+ error[E0404]: expected trait, found type alias `A`
+    |
+    |
+ LL |         let _ = |a, b| -> impl A + B {}; // OK
+    |                                ^ type aliases cannot be used as traits
+    |
+ help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+    |
+    |
+ LL | type A = fn() -> impl A +;
+ 
+ 
+ error[E0405]: cannot find trait `B` in this scope
+    |
+    |
+ LL |         let _ = |a, b| -> impl A + B {}; // OK
+    |                                    ^ not found in this scope
+ 
+ error[E0404]: expected trait, found type alias `A`
+    |
+    |
+ LL |     fn f(self) -> dyn A + B { // OK
+    |                       ^ type aliases cannot be used as traits
+    |
+ help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+    |
+    |
+ LL | type A = fn() -> impl A +;
+ 
+ 
+ error[E0405]: cannot find trait `B` in this scope
+    |
+    |
+ LL |     fn f(self) -> dyn A + B { // OK
+    |                           ^ not found in this scope
+ 
+ error[E0404]: expected trait, found type alias `A`
+    |
+    |
+ LL |         let _ = |a, b| -> dyn A + B {}; // OK
+    |                               ^ type aliases cannot be used as traits
+    |
+ help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+    |
+    |
+ LL | type A = fn() -> impl A +;
+ 
+ 
+ error[E0405]: cannot find trait `B` in this scope
+    |
+    |
+ LL |         let _ = |a, b| -> dyn A + B {}; // OK
+    |                                   ^ not found in this scope
+ 
+ error[E0404]: expected trait, found type alias `A`
+    |
+    |
+ LL |     fn f(self) -> A + B { // OK
+    |                   ^ type aliases cannot be used as traits
+    |
+ help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+    |
+    |
+ LL | type A = fn() -> impl A +;
+ 
+ 
+ error[E0405]: cannot find trait `B` in this scope
+    |
+    |
+ LL |     fn f(self) -> A + B { // OK
+    |                       ^ not found in this scope
+ 
+ error[E0404]: expected trait, found type alias `A`
+    |
+    |
+ LL |         let _ = |a, b| -> A + B {}; // OK
+    |                           ^ type aliases cannot be used as traits
+    |
+ help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+    |
+    |
+ LL | type A = fn() -> impl A +;
+ 
+ 
+ error[E0405]: cannot find trait `B` in this scope
+    |
+    |
+ LL |         let _ = |a, b| -> A + B {}; // OK
+    |                               ^ not found in this scope
+ 
+ error[E0404]: expected trait, found type alias `A`
+    |
+    |
+ LL | type A = fn() -> impl A +;
+    |                       ^ type aliases cannot be used as traits
+    |
+ help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+    |
+    |
+ LL | type A = fn() -> impl A +;
+ 
+ 
+ error[E0404]: expected trait, found type alias `A`
+    |
+    |
+ LL | type A = fn() -> impl A + B;
+    |                       ^ type aliases cannot be used as traits
+    |
+ help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+    |
+    |
+ LL | type A = fn() -> impl A +;
+ 
+ 
+ error[E0405]: cannot find trait `B` in this scope
+    |
+    |
+ LL | type A = fn() -> impl A + B;
+    |                           ^ not found in this scope
+ 
+ error[E0404]: expected trait, found type alias `A`
+    |
+    |
+ LL | type A = fn() -> dyn A + B;
+    |                      ^ type aliases cannot be used as traits
+    |
+ help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+    |
+    |
+ LL | type A = fn() -> impl A +;
+ 
+ 
+ error[E0405]: cannot find trait `B` in this scope
+    |
+    |
+ LL | type A = fn() -> dyn A + B;
+    |                          ^ not found in this scope
+ 
+ error[E0404]: expected trait, found type alias `A`
+    |
+    |
+ LL | type A = Fn() -> impl A +;
+    |                       ^ type aliases cannot be used as traits
+    |
+ help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+    |
+    |
+ LL | type A = fn() -> impl A +;
+ 
+ 
+ error[E0404]: expected trait, found type alias `A`
+    |
+    |
+ LL | type A = Fn() -> impl A + B;
+    |                       ^ type aliases cannot be used as traits
+    |
+ help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+    |
+    |
+ LL | type A = fn() -> impl A +;
+ 
+ 
+ error[E0405]: cannot find trait `B` in this scope
+    |
+    |
+ LL | type A = Fn() -> impl A + B;
+    |                           ^ not found in this scope
+ 
+ error[E0404]: expected trait, found type alias `A`
+    |
+    |
+ LL | type A = Fn() -> dyn A + B;
+    |                      ^ type aliases cannot be used as traits
+    |
+ help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+    |
+    |
+ LL | type A = fn() -> impl A +;
+ 
+ 
+ error[E0405]: cannot find trait `B` in this scope
+    |
+    |
+ LL | type A = Fn() -> dyn A + B;
+    |                          ^ not found in this scope
+ 
+ error[E0405]: cannot find trait `B` in this scope
+    |
+    |
+ LL | type A = Fn() -> A + B; // OK, interpreted as `(Fn() -> A) + B` for compatibility
+    |                      ^ not found in this scope
+ 
+ error[E0404]: expected trait, found type alias `A`
+    |
+    |
+ LL | type A = &impl A +;
+    |                ^ type aliases cannot be used as traits
+    |
+ help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+    |
+    |
+ LL | type A = fn() -> impl A +;
+ 
+ 
+ error[E0404]: expected trait, found type alias `A`
+    |
+    |
+ LL | type A = &impl A + B;
+    |                ^ type aliases cannot be used as traits
+    |
+ help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+    |
+    |
+ LL | type A = fn() -> impl A +;
+ 
---
15 


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/bounds-type/bounds-type.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args parser/bounds-type.rs`
error: 1 errors occurred comparing output.
status: exit code: 1
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/parser/bounds-type.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zemit-future-incompat-report" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/bounds-type" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Z" "parse-only" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/bounds-type/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error: `?` may only modify trait bounds, not lifetime bounds
   |
   |
LL |     T: ?'a, //~ ERROR `?` may only modify trait bounds, not lifetime bounds


error: `?const` may only modify trait bounds, not lifetime bounds
   |
   |
LL |     T: ?const 'a, //~ ERROR `?const` may only modify trait bounds, not lifetime bounds


error: `?const` and `?` are mutually exclusive
   |
   |
LL |     T: ?const ?Tr, // OK


error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
   |
   |
LL |     T: 'a + Tr, // OK
   |     - first use of `T`
LL |     T: Tr + 'a, // OK
   |     ^ already used

error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
   |
   |
LL |     T: 'a + Tr, // OK
   |     - first use of `T`
LL |     T: Tr + 'a, // OK
LL |     T: 'a, // OK
   |     ^ already used

error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
   |
   |
LL |     T: 'a + Tr, // OK
   |     - first use of `T`
...
LL |     T:, // OK
   |     ^ already used

error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
   |
   |
LL |     T: 'a + Tr, // OK
   |     - first use of `T`
...
LL |     T: ?for<'a> Trait, // OK
   |     ^ already used

error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
   |
   |
LL |     T: 'a + Tr, // OK
   |     - first use of `T`
...
LL |     T: Tr +, // OK
   |     ^ already used

error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
   |
   |
LL |     T: 'a + Tr, // OK
   |     - first use of `T`
...
LL |     T: ?'a, //~ ERROR `?` may only modify trait bounds, not lifetime bounds
   |     ^ already used

error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
   |
   |
LL |     T: 'a + Tr, // OK
   |     - first use of `T`
...
LL |     T: ?const Tr, // OK
   |     ^ already used

error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
   |
   |
LL |     T: 'a + Tr, // OK
   |     - first use of `T`
...
LL |     T: ?const ?Tr, // OK
   |     ^ already used

error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
   |
   |
LL |     T: 'a + Tr, // OK
   |     - first use of `T`
...
LL |     T: ?const Tr + 'a, // OK
   |     ^ already used

error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
   |
   |
LL |     T: 'a + Tr, // OK
   |     - first use of `T`
...
LL |     T: ?const 'a, //~ ERROR `?const` may only modify trait bounds, not lifetime bounds
   |     ^ already used

error[E0405]: cannot find trait `Tr` in this scope
   |
   |
LL |     T: 'a + Tr, // OK
   |             ^^ not found in this scope

error[E0405]: cannot find trait `Tr` in this scope
   |
   |
LL |     T: Tr + 'a, // OK
   |        ^^ not found in this scope

error[E0405]: cannot find trait `Trait` in this scope
   |
   |
LL |     T: ?for<'a> Trait, // OK


error[E0405]: cannot find trait `Tr` in this scope
   |
   |
LL |     T: Tr +, // OK
   |        ^^ not found in this scope

error[E0405]: cannot find trait `Tr` in this scope
   |
   |
LL |     T: ?const Tr, // OK
   |               ^^ not found in this scope

error[E0405]: cannot find trait `Tr` in this scope
   |
   |
LL |     T: ?const ?Tr, // OK
   |                ^^ not found in this scope

error[E0405]: cannot find trait `Tr` in this scope
   |
   |
LL |     T: ?const Tr + 'a, // OK
   |               ^^ not found in this scope

error[E0658]: `?const` on trait bounds is experimental
   |
   |
LL |     T: ?const Tr, // OK
   |
   = note: see issue #67794 <https://github.com/rust-lang/rust/issues/67794> for more information
   = help: add `#![feature(const_trait_bound_opt_out)]` to the crate attributes to enable


error[E0658]: `?const` on trait bounds is experimental
   |
   |
LL |     T: ?const ?Tr, // OK
   |
   = note: see issue #67794 <https://github.com/rust-lang/rust/issues/67794> for more information
   = help: add `#![feature(const_trait_bound_opt_out)]` to the crate attributes to enable


error[E0658]: `?const` on trait bounds is experimental
   |
   |
LL |     T: ?const Tr + 'a, // OK
   |
   = note: see issue #67794 <https://github.com/rust-lang/rust/issues/67794> for more information
   = help: add `#![feature(const_trait_bound_opt_out)]` to the crate attributes to enable


error[E0658]: `?const` on trait bounds is experimental
   |
   |
LL |     T: ?const 'a, //~ ERROR `?const` may only modify trait bounds, not lifetime bounds
   |
   = note: see issue #67794 <https://github.com/rust-lang/rust/issues/67794> for more information
   = help: add `#![feature(const_trait_bound_opt_out)]` to the crate attributes to enable

---
normalized stderr:
error[E0433]: failed to resolve: use of undeclared type `Trait`
  --> $DIR/impl-qpath.rs:5:15
   |
LL | impl <Type as Trait>::AssocTy {} // OK
   |               ^^^^^ use of undeclared type `Trait`
error[E0412]: cannot find type `Type` in this scope
  --> $DIR/impl-qpath.rs:5:7
   |
   |
LL | impl <Type as Trait>::AssocTy {} // OK


error[E0405]: cannot find trait `Trait` in this scope
  --> $DIR/impl-qpath.rs:6:12
   |
LL | impl <'a + Trait>::AssocTy {} // OK

error[E0412]: cannot find type `Type` in this scope
  --> $DIR/impl-qpath.rs:7:8
   |
   |
LL | impl <<Type>::AssocTy>::AssocTy {} // OK

warning: trait objects without an explicit `dyn` are deprecated
  --> $DIR/impl-qpath.rs:6:7
   |
   |
LL | impl <'a + Trait>::AssocTy {} // OK
   |       ^^^^^^^^^^ help: use `dyn`: `dyn 'a + Trait`
   = note: `#[warn(bare_trait_objects)]` on by default

error: aborting due to 4 previous errors; 1 warning emitted


Some errors have detailed explanations: E0405, E0412, E0433.
For more information about an error, try `rustc --explain E0405`.



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/impl-qpath/impl-qpath.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args parser/impl-qpath.rs`
error: 1 errors occurred comparing output.
status: exit code: 0
status: exit code: 0
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/parser/impl-qpath.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zemit-future-incompat-report" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/impl-qpath" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Z" "parse-only" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/impl-qpath/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error[E0433]: failed to resolve: use of undeclared type `Trait`
  --> /checkout/src/test/ui/parser/impl-qpath.rs:5:15
   |
LL | impl <Type as Trait>::AssocTy {} // OK
   |               ^^^^^ use of undeclared type `Trait`
error[E0412]: cannot find type `Type` in this scope
  --> /checkout/src/test/ui/parser/impl-qpath.rs:5:7
   |
   |
LL | impl <Type as Trait>::AssocTy {} // OK


error[E0405]: cannot find trait `Trait` in this scope
  --> /checkout/src/test/ui/parser/impl-qpath.rs:6:12
   |
LL | impl <'a + Trait>::AssocTy {} // OK

error[E0412]: cannot find type `Type` in this scope
  --> /checkout/src/test/ui/parser/impl-qpath.rs:7:8
   |
   |
LL | impl <<Type>::AssocTy>::AssocTy {} // OK

warning: trait objects without an explicit `dyn` are deprecated
  --> /checkout/src/test/ui/parser/impl-qpath.rs:6:7
   |
   |
LL | impl <'a + Trait>::AssocTy {} // OK
   |       ^^^^^^^^^^ help: use `dyn`: `dyn 'a + Trait`
   = note: `#[warn(bare_trait_objects)]` on by default

error: aborting due to 4 previous errors; 1 warning emitted

---


---- [ui] ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/syntax.rs stdout ----
normalized stderr:
error: `?const` and `?` are mutually exclusive
   |
   |
LL |     T: ?const ?for<'a> Tr<'a> + 'static + ?const std::ops::Add,


error: `?const` and `?` are mutually exclusive
   |
   |
LL |     T: ?const ?for<'a: 'b> m::Trait<'a>,

error: lifetime bounds cannot be used in this context
  --> $DIR/syntax.rs:9:24
   |
   |
LL |     T: ?const ?for<'a: 'b> m::Trait<'a>,


error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
   |
   |
LL |     T: ?const ?for<'a> Tr<'a> + 'static + ?const std::ops::Add,
   |     - first use of `T`
LL |     T: ?const ?for<'a: 'b> m::Trait<'a>,
   |     ^ already used
error[E0433]: failed to resolve: use of undeclared crate or module `m`
  --> $DIR/syntax.rs:9:28
   |
   |
LL |     T: ?const ?for<'a: 'b> m::Trait<'a>,
   |                            ^ use of undeclared crate or module `m`

error[E0405]: cannot find trait `Tr` in this scope
   |
   |
LL |     T: ?const ?for<'a> Tr<'a> + 'static + ?const std::ops::Add,
   |                        ^^ not found in this scope
error: aborting due to 6 previous errors

Some errors have detailed explanations: E0403, E0405, E0433.
For more information about an error, try `rustc --explain E0403`.
For more information about an error, try `rustc --explain E0403`.



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/syntax/syntax.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args rfc-2632-const-trait-impl/const-trait-bound-opt-out/syntax.rs`
error: 1 errors occurred comparing output.
status: exit code: 0
status: exit code: 0
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/syntax.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zemit-future-incompat-report" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/syntax" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Z" "parse-only" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/syntax/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error: `?const` and `?` are mutually exclusive
   |
   |
LL |     T: ?const ?for<'a> Tr<'a> + 'static + ?const std::ops::Add,


error: `?const` and `?` are mutually exclusive
   |
   |
LL |     T: ?const ?for<'a: 'b> m::Trait<'a>,

error: lifetime bounds cannot be used in this context
  --> /checkout/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/syntax.rs:9:24
   |
   |
LL |     T: ?const ?for<'a: 'b> m::Trait<'a>,


error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
   |
   |
LL |     T: ?const ?for<'a> Tr<'a> + 'static + ?const std::ops::Add,
   |     - first use of `T`
LL |     T: ?const ?for<'a: 'b> m::Trait<'a>,
   |     ^ already used
error[E0433]: failed to resolve: use of undeclared crate or module `m`
  --> /checkout/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/syntax.rs:9:28
   |
   |
LL |     T: ?const ?for<'a: 'b> m::Trait<'a>,
   |                            ^ use of undeclared crate or module `m`

error[E0405]: cannot find trait `Tr` in this scope
   |
   |
LL |     T: ?const ?for<'a> Tr<'a> + 'static + ?const std::ops::Add,
   |                        ^^ not found in this scope
error: aborting due to 6 previous errors

Some errors have detailed explanations: E0403, E0405, E0433.
For more information about an error, try `rustc --explain E0403`.
For more information about an error, try `rustc --explain E0403`.

------------------------------------------


---- [ui] ui/rfc-2632-const-trait-impl/syntax.rs stdout ----
normalized stderr:
error: `?const` is not permitted in trait objects
   |
   |
LL | impl ?const T {}


error[E0405]: cannot find trait `T` in this scope
   |
   |
LL | impl ?const T {}
   |             ^ not found in this scope
warning: trait objects without an explicit `dyn` are deprecated
  --> $DIR/syntax.rs:9:6
   |
   |
LL | impl ?const T {}
   |      ^^^^^^^^ help: use `dyn`: `dyn ?const T`
   = note: `#[warn(bare_trait_objects)]` on by default

error: aborting due to 2 previous errors; 1 warning emitted


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



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rfc-2632-const-trait-impl/syntax/syntax.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args rfc-2632-const-trait-impl/syntax.rs`
error: 1 errors occurred comparing output.
status: exit code: 0
status: exit code: 0
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/rfc-2632-const-trait-impl/syntax.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zemit-future-incompat-report" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rfc-2632-const-trait-impl/syntax" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Z" "parse-only" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rfc-2632-const-trait-impl/syntax/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error: `?const` is not permitted in trait objects
   |
   |
LL | impl ?const T {}


error[E0405]: cannot find trait `T` in this scope
   |
   |
LL | impl ?const T {}
   |             ^ not found in this scope
warning: trait objects without an explicit `dyn` are deprecated
  --> /checkout/src/test/ui/rfc-2632-const-trait-impl/syntax.rs:9:6
   |
   |
LL | impl ?const T {}
   |      ^^^^^^^^ help: use `dyn`: `dyn ?const T`
   = note: `#[warn(bare_trait_objects)]` on by default

error: aborting due to 2 previous errors; 1 warning emitted

---
test result: FAILED. 11182 passed; 8 failed; 87 ignored; 0 measured; 0 filtered out; finished in 134.41s



command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--suite" "ui" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-9/bin/FileCheck" "--nodejs" "/usr/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python3" "--lldb-python" "/usr/bin/python3" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "9.0.0" "--llvm-components" "aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver engine executionengine fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo irreader jitlink lanai lanaiasmparser lanaicodegen lanaidesc lanaidisassembler lanaiinfo libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcjit passes perfjitevents powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvutils runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xcore xcorecodegen xcoredesc xcoredisassembler xcoreinfo xray" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"


failed to run: /checkout/obj/build/bootstrap/debug/bootstrap --stage 2 test --exclude src/tools/tidy
Build completed unsuccessfully in 0:14:23

This is no longer necessary now that rustdoc doesn't run
everybody_loops.
@jyn514
Copy link
Member Author

jyn514 commented Jan 22, 2021

Another idea I thought of - rather than making each tool call this on its own, it might be easier to add it to the drop impl of GlobalCtxt.

Ugh - so the modified version of this idea I came up with, add it to Compiler::enter instead, doesn't work because rustdoc steal()s the GlobalCtxt. When Compiler tries to calculate it again, it panics because rustdoc messed with the resolver:

For now I reverted the change and just had rustdoc call it manually. I was playing with adding it to impl Drop for QueryContext, but I couldn't get the lifetimes to work.

I unreverted this and removed the call to take() in rustdoc (it was unnecessary). Now this is failing because there are additional errors, I think because it now tries to run rustc_resolve even if there were parse errors. I'll see if I can only print the stats if the GlobalCtxt has already been constructed.

This happened because `alloc_query_strings` was never called.
Copy link
Member

@wesleywiser wesleywiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small piece of feedback. Feel free to r=me after!

src/librustdoc/formats/renderer.rs Outdated Show resolved Hide resolved
- Show `create_renderer` and `renderer_after_crate` by default
- Don't rewrite `extra_verbose_generic_activity`
This avoids each tool having to separately find and call
`self_profile_alloc_strings`.

- Don't compute the global context if it hasn't yet been computed

  This avoids giving extraneous errors about unresolved names if an error
  occurs during parsing.
@jyn514
Copy link
Member Author

jyn514 commented Jan 23, 2021

@bors r=wesleywiser

Thanks for the review!

@bors
Copy link
Contributor

bors commented Jan 23, 2021

📌 Commit ca72f9e has been approved by wesleywiser

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 23, 2021
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 23, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 23, 2021
…as-schievink

Rollup of 15 pull requests

Successful merges:

 - rust-lang#79841 (More clear documentation for NonNull<T>)
 - rust-lang#81072 (PlaceRef::ty: use method call syntax)
 - rust-lang#81130 (Edit rustc_middle::dep_graph module documentation)
 - rust-lang#81170 (Avoid hash_slice in VecDeque's Hash implementation)
 - rust-lang#81243 (mir: Improve size_of handling when arg is unsized)
 - rust-lang#81245 (Update cargo)
 - rust-lang#81249 (Lower closure prototype after its body.)
 - rust-lang#81252 (Add more self-profile info to rustc_resolve)
 - rust-lang#81275 (Fix <unknown> queries and add more timing info to render_html)
 - rust-lang#81281 (Inline methods of Path and OsString)
 - rust-lang#81283 (Note library tracking issue template in tracking issue template.)
 - rust-lang#81285 (Remove special casing of rustdoc in rustc_lint)
 - rust-lang#81288 (rustdoc: Fix visibility of trait and impl items)
 - rust-lang#81298 (replace RefCell with Cell in FnCtxt)
 - rust-lang#81301 (Fix small typo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 81647c6 into rust-lang:master Jan 24, 2021
@rustbot rustbot added this to the 1.51.0 milestone Jan 24, 2021
@jyn514 jyn514 deleted the time-render branch January 24, 2021 00:43
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jan 26, 2021
Make `-Z time-passes` less noisy

- Add the module name to `pre_AST_expansion_passes` and don't make it a
  verbose event (since it normally doesn't take very long, and it's
  emitted many times)
- Don't make the following rustdoc events verbose; they're emitted many times.
  + build_extern_trait_impl
  + build_local_trait_impl
  + build_primitive_trait_impl
  + get_auto_trait_impls
  + get_blanket_trait_impls
- Remove the `get_auto_trait_and_blanket_synthetic_impls` rustdoc event; it's wholly
  covered by get_{auto,blanket}_trait_impls and not very useful.

I found this while working on rust-lang#81275 but it's independent of those changes.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Jan 27, 2021
Make `-Z time-passes` less noisy

- Add the module name to `pre_AST_expansion_passes` and don't make it a
  verbose event (since it normally doesn't take very long, and it's
  emitted many times)
- Don't make the following rustdoc events verbose; they're emitted many times.
  + build_extern_trait_impl
  + build_local_trait_impl
  + build_primitive_trait_impl
  + get_auto_trait_impls
  + get_blanket_trait_impls
- Remove the `get_auto_trait_and_blanket_synthetic_impls` rustdoc event; it's wholly
  covered by get_{auto,blanket}_trait_impls and not very useful.

I found this while working on rust-lang#81275 but it's independent of those changes.
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jan 28, 2021
Make `-Z time-passes` less noisy

- Add the module name to `pre_AST_expansion_passes` and don't make it a
  verbose event (since it normally doesn't take very long, and it's
  emitted many times)
- Don't make the following rustdoc events verbose; they're emitted many times.
  + build_extern_trait_impl
  + build_local_trait_impl
  + build_primitive_trait_impl
  + get_auto_trait_impls
  + get_blanket_trait_impls
- Remove the `get_auto_trait_and_blanket_synthetic_impls` rustdoc event; it's wholly
  covered by get_{auto,blanket}_trait_impls and not very useful.

I found this while working on rust-lang#81275 but it's independent of those changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-self-profile Area: Self-profiling feature of the compiler S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. WG-compiler-performance Working group: Compiler Performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A third of the time rustdoc takes to document windows-rs is <unknown>
6 participants