diff options
| author | bors <bors@rust-lang.org> | 2021-10-16 06:31:40 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-10-16 06:31:40 +0000 |
| commit | 7fbd4ce2768744b3bd2ddf8453b73f4f18dbe5bc (patch) | |
| tree | a48662f4f9bb7838999ffaa5042f953bd588447b /src | |
| parent | 6cc0a764e082d9c0abcf37a768d5889247ba13e2 (diff) | |
| parent | 8e2047042581da8ee5ab8c7ad5780c1d690eecea (diff) | |
| download | rust-7fbd4ce2768744b3bd2ddf8453b73f4f18dbe5bc.tar.gz rust-7fbd4ce2768744b3bd2ddf8453b73f4f18dbe5bc.zip | |
Auto merge of #89939 - matthiaskrgr:rollup-q3lrdck, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - #89509 (Stabilize `unreachable_unchecked` as `const fn`) - #89898 (Remove alloc::prelude) - #89902 (Restrict the aarch64 outline atomics test to Linux) - #89906 (Moved format-version constant to rustdoc-json-types) - #89912 (emitter: current substitution can be multi-line) - #89914 (Emit impl difference error for GenericBoundFailure too) - #89915 (Some outlives cleanup) - #89918 (Add some GATs related regression tests) - #89921 ([fuchsia] Update process info struct) - #89925 (updating docs to mention usage of AtomicBool) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src')
14 files changed, 117 insertions, 25 deletions
diff --git a/src/librustdoc/json/mod.rs b/src/librustdoc/json/mod.rs index 637e5f2288d..0031e3915fa 100644 --- a/src/librustdoc/json/mod.rs +++ b/src/librustdoc/json/mod.rs @@ -255,7 +255,7 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> { ) }) .collect(), - format_version: 9, + format_version: types::FORMAT_VERSION, }; let mut p = self.out_path.clone(); p.push(output.index.get(&output.root).unwrap().name.clone().unwrap()); diff --git a/src/rustdoc-json-types/lib.rs b/src/rustdoc-json-types/lib.rs index 7c418697c1c..9466f84ffcd 100644 --- a/src/rustdoc-json-types/lib.rs +++ b/src/rustdoc-json-types/lib.rs @@ -510,5 +510,8 @@ pub struct Static { pub expr: String, } +/// rustdoc format-version. +pub const FORMAT_VERSION: u32 = 9; + #[cfg(test)] mod tests; diff --git a/src/test/assembly/asm/aarch64-outline-atomics.rs b/src/test/assembly/asm/aarch64-outline-atomics.rs index 93dda712e1b..42cef9bb679 100644 --- a/src/test/assembly/asm/aarch64-outline-atomics.rs +++ b/src/test/assembly/asm/aarch64-outline-atomics.rs @@ -4,6 +4,7 @@ // compile-flags: --target aarch64-unknown-linux-gnu // needs-llvm-components: aarch64 // only-aarch64 +// only-linux #![crate_type = "rlib"] diff --git a/src/test/ui/consts/const_unsafe_unreachable.rs b/src/test/ui/consts/const_unsafe_unreachable.rs index 1fec491ca95..1c3baec5d86 100644 --- a/src/test/ui/consts/const_unsafe_unreachable.rs +++ b/src/test/ui/consts/const_unsafe_unreachable.rs @@ -1,7 +1,5 @@ // run-pass -#![feature(const_unreachable_unchecked)] - const unsafe fn foo(x: bool) -> bool { match x { true => true, @@ -12,5 +10,5 @@ const unsafe fn foo(x: bool) -> bool { const BAR: bool = unsafe { foo(true) }; fn main() { - assert_eq!(BAR, true); + assert_eq!(BAR, true); } diff --git a/src/test/ui/consts/const_unsafe_unreachable_ub.rs b/src/test/ui/consts/const_unsafe_unreachable_ub.rs index 8cee5b50651..b418fea617c 100644 --- a/src/test/ui/consts/const_unsafe_unreachable_ub.rs +++ b/src/test/ui/consts/const_unsafe_unreachable_ub.rs @@ -1,5 +1,4 @@ // error-pattern: evaluation of constant value failed -#![feature(const_unreachable_unchecked)] const unsafe fn foo(x: bool) -> bool { match x { @@ -11,5 +10,5 @@ const unsafe fn foo(x: bool) -> bool { const BAR: bool = unsafe { foo(false) }; fn main() { - assert_eq!(BAR, true); + assert_eq!(BAR, true); } diff --git a/src/test/ui/consts/const_unsafe_unreachable_ub.stderr b/src/test/ui/consts/const_unsafe_unreachable_ub.stderr index 65cb3d74b23..ec6ce1f5d7c 100644 --- a/src/test/ui/consts/const_unsafe_unreachable_ub.stderr +++ b/src/test/ui/consts/const_unsafe_unreachable_ub.stderr @@ -7,13 +7,13 @@ LL | unsafe { intrinsics::unreachable() } | entering unreachable code | inside `unreachable_unchecked` at $SRC_DIR/core/src/hint.rs:LL:COL | - ::: $DIR/const_unsafe_unreachable_ub.rs:7:18 + ::: $DIR/const_unsafe_unreachable_ub.rs:6:18 | LL | false => std::hint::unreachable_unchecked(), - | ---------------------------------- inside `foo` at $DIR/const_unsafe_unreachable_ub.rs:7:18 + | ---------------------------------- inside `foo` at $DIR/const_unsafe_unreachable_ub.rs:6:18 ... LL | const BAR: bool = unsafe { foo(false) }; - | ---------- inside `BAR` at $DIR/const_unsafe_unreachable_ub.rs:11:28 + | ---------- inside `BAR` at $DIR/const_unsafe_unreachable_ub.rs:10:28 error: aborting due to previous error diff --git a/src/test/ui/errors/issue-89280-emitter-overflow-splice-lines.rs b/src/test/ui/errors/issue-89280-emitter-overflow-splice-lines.rs new file mode 100644 index 00000000000..a1c7af128d2 --- /dev/null +++ b/src/test/ui/errors/issue-89280-emitter-overflow-splice-lines.rs @@ -0,0 +1,10 @@ +// check-pass + +trait X { + fn test(x: u32, ( +//~^ WARN anonymous parameters are deprecated and will be removed in the next edition +//~^^ WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! + )) {} +} + +fn main() {} diff --git a/src/test/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr b/src/test/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr new file mode 100644 index 00000000000..4ec78a298fe --- /dev/null +++ b/src/test/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr @@ -0,0 +1,23 @@ +warning: anonymous parameters are deprecated and will be removed in the next edition + --> $DIR/issue-89280-emitter-overflow-splice-lines.rs:4:21 + | +LL | fn test(x: u32, ( + | _____________________^ +LL | | +LL | | +LL | | )) {} + | |_____^ + | + = note: `#[warn(anonymous_parameters)]` on by default + = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! + = note: for more information, see issue #41686 <https://github.com/rust-lang/rust/issues/41686> +help: try naming the parameter or explicitly ignoring it + | +LL ~ fn test(x: u32, _: ( +LL + +LL + +LL ~ )) {} + | + +warning: 1 warning emitted + diff --git a/src/test/ui/generic-associated-types/impl_bounds.rs b/src/test/ui/generic-associated-types/impl_bounds.rs index 27c135cb7cf..ff2ffec22c4 100644 --- a/src/test/ui/generic-associated-types/impl_bounds.rs +++ b/src/test/ui/generic-associated-types/impl_bounds.rs @@ -13,7 +13,7 @@ struct Fooy<T>(T); impl<T> Foo for Fooy<T> { type A<'a> where Self: 'static = (&'a ()); - //~^ ERROR the parameter type `T` may not live long enough + //~^ ERROR `impl` associated type type B<'a, 'b> where 'b: 'a = (&'a(), &'b ()); //~^ ERROR `impl` associated type //~| ERROR lifetime bound not satisfied diff --git a/src/test/ui/generic-associated-types/impl_bounds.stderr b/src/test/ui/generic-associated-types/impl_bounds.stderr index 649eadec515..f47b5f81e25 100644 --- a/src/test/ui/generic-associated-types/impl_bounds.stderr +++ b/src/test/ui/generic-associated-types/impl_bounds.stderr @@ -1,11 +1,11 @@ -error[E0310]: the parameter type `T` may not live long enough +error: `impl` associated type signature for `A` doesn't match `trait` associated type signature --> $DIR/impl_bounds.rs:15:5 | +LL | type A<'a> where Self: 'a; + | -------------------------- expected +... LL | type A<'a> where Self: 'static = (&'a ()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider adding an explicit lifetime bound `T: 'static`... - = note: ...so that the definition in impl matches the definition from the trait + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found error: `impl` associated type signature for `B` doesn't match `trait` associated type signature --> $DIR/impl_bounds.rs:17:5 @@ -85,5 +85,5 @@ LL | impl<T: std::marker::Copy> Foo for Fooy<T> { error: aborting due to 5 previous errors -Some errors have detailed explanations: E0277, E0310, E0478. +Some errors have detailed explanations: E0277, E0478. For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/ui/generic-associated-types/issue-86787.rs b/src/test/ui/generic-associated-types/issue-86787.rs index 57d478a9ef1..f1f05ea6627 100644 --- a/src/test/ui/generic-associated-types/issue-86787.rs +++ b/src/test/ui/generic-associated-types/issue-86787.rs @@ -21,8 +21,8 @@ where { type T = Either<Left::T, Right::T>; type TRef<'a> - //~^ the associated type - //~^^ the associated type + //~^ `impl` associated type signature + //~^^ `impl` associated type signature where <Left as HasChildrenOf>::T: 'a, <Right as HasChildrenOf>::T: 'a diff --git a/src/test/ui/generic-associated-types/issue-86787.stderr b/src/test/ui/generic-associated-types/issue-86787.stderr index e1ff7729211..648eff77d73 100644 --- a/src/test/ui/generic-associated-types/issue-86787.stderr +++ b/src/test/ui/generic-associated-types/issue-86787.stderr @@ -1,29 +1,32 @@ -error[E0309]: the associated type `<Left as HasChildrenOf>::T` may not live long enough +error: `impl` associated type signature for `TRef` doesn't match `trait` associated type signature --> $DIR/issue-86787.rs:23:5 | +LL | type TRef<'a>; + | -------------- expected +... LL | / type TRef<'a> LL | | LL | | LL | | where LL | | <Left as HasChildrenOf>::T: 'a, LL | | <Right as HasChildrenOf>::T: 'a - | | - help: consider adding a where clause: `, <Left as HasChildrenOf>::T: 'a` LL | | = Either<&'a Left::T, &'a Right::T>; - | |________________________________________^ ...so that the definition in impl matches the definition from the trait + | |________________________________________^ found -error[E0309]: the associated type `<Right as HasChildrenOf>::T` may not live long enough +error: `impl` associated type signature for `TRef` doesn't match `trait` associated type signature --> $DIR/issue-86787.rs:23:5 | +LL | type TRef<'a>; + | -------------- expected +... LL | / type TRef<'a> LL | | LL | | LL | | where LL | | <Left as HasChildrenOf>::T: 'a, LL | | <Right as HasChildrenOf>::T: 'a - | | - help: consider adding a where clause: `, <Right as HasChildrenOf>::T: 'a` LL | | = Either<&'a Left::T, &'a Right::T>; - | |________________________________________^ ...so that the definition in impl matches the definition from the trait + | |________________________________________^ found error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/ui/generic-associated-types/issue-88287.rs b/src/test/ui/generic-associated-types/issue-88287.rs new file mode 100644 index 00000000000..2e65af594a6 --- /dev/null +++ b/src/test/ui/generic-associated-types/issue-88287.rs @@ -0,0 +1,39 @@ +// check-pass +// edition:2018 + +#![feature(generic_associated_types)] +#![feature(type_alias_impl_trait)] + +use std::future::Future; + +trait SearchableResource<Criteria> { + type SearchResult; +} + +trait SearchableResourceExt<Criteria>: SearchableResource<Criteria> { + type Future<'f, A: 'f + ?Sized, B: 'f>: Future<Output = Result<Vec<A::SearchResult>, ()>> + 'f + where + A: SearchableResource<B>; + + fn search<'c>(&'c self, client: &'c ()) -> Self::Future<'c, Self, Criteria>; +} + +type SearchFutureTy<'f, A, B: 'f> +where + A: SearchableResource<B> + ?Sized + 'f, += impl Future<Output = Result<Vec<A::SearchResult>, ()>> + 'f; +impl<T, Criteria> SearchableResourceExt<Criteria> for T +where + T: SearchableResource<Criteria>, +{ + type Future<'f, A, B: 'f> + where + A: SearchableResource<B> + ?Sized + 'f, + = SearchFutureTy<'f, A, B>; + + fn search<'c>(&'c self, _client: &'c ()) -> Self::Future<'c, Self, Criteria> { + async move { todo!() } + } +} + +fn main() {} diff --git a/src/test/ui/generic-associated-types/issue-88405.rs b/src/test/ui/generic-associated-types/issue-88405.rs new file mode 100644 index 00000000000..4a405bd3625 --- /dev/null +++ b/src/test/ui/generic-associated-types/issue-88405.rs @@ -0,0 +1,16 @@ +// check-pass + +#![feature(generic_associated_types)] + +trait SomeTrait {} +trait OtherTrait { + type Item; +} + +trait ErrorSimpleExample { + type AssociatedType: SomeTrait; + type GatBounded<T: SomeTrait>; + type ErrorMinimal: OtherTrait<Item = Self::GatBounded<Self::AssociatedType>>; +} + +fn main() {} |
