diff options
| author | bors <bors@rust-lang.org> | 2021-10-13 13:41:48 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-10-13 13:41:48 +0000 |
| commit | 81117ff930fbf3792b4f9504e3c6bccc87b10823 (patch) | |
| tree | 482f94bab819f43aff8f02d7225f58826d438004 /src | |
| parent | 5728bd64b49b0e78d0180efed75ef0870ae60266 (diff) | |
| parent | e21f8920d33e7e42f64c7afbb27f77a8b110db35 (diff) | |
| download | rust-81117ff930fbf3792b4f9504e3c6bccc87b10823.tar.gz rust-81117ff930fbf3792b4f9504e3c6bccc87b10823.zip | |
Auto merge of #89847 - JohnTitor:rollup-xfymeo4, r=JohnTitor
Rollup of 12 pull requests Successful merges: - #89768 (add some more testcases) - #89777 (Edit explanation of test for nested type ascriptions) - #89781 (Add missing words in `Infallible` docs) - #89782 (Improve CJK font in rustdoc) - #89794 (Add #[must_use] to to_value conversions) - #89814 (Fix uppercase/lowercase error) - #89816 (Fix invalid rules in .gitignore) - #89817 (Add #[inline] to int log10 functions.) - #89818 (Use Option::map_or instead of open coding it) - #89828 (Fix config.toml overflow-checks options) - #89840 (fix the stage0 tools config file path in `config.toml.example`) - #89845 (Add davidtwco to the `.mailmap`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src')
16 files changed, 207 insertions, 15 deletions
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 062820040dc..7818b8b7d51 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -982,7 +982,8 @@ impl Config { config.rust_debug_assertions_std = debug_assertions_std.unwrap_or(config.rust_debug_assertions); config.rust_overflow_checks = overflow_checks.unwrap_or(default); - config.rust_overflow_checks_std = overflow_checks_std.unwrap_or(default); + config.rust_overflow_checks_std = + overflow_checks_std.unwrap_or(config.rust_overflow_checks); config.rust_debug_logging = debug_logging.unwrap_or(config.rust_debug_assertions); diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py index fd148d14478..94424cb4548 100755 --- a/src/bootstrap/configure.py +++ b/src/bootstrap/configure.py @@ -75,7 +75,9 @@ o("optimize-llvm", "llvm.optimize", "build optimized LLVM") o("llvm-assertions", "llvm.assertions", "build LLVM with assertions") o("llvm-plugins", "llvm.plugins", "build LLVM with plugin interface") o("debug-assertions", "rust.debug-assertions", "build with debugging assertions") +o("debug-assertions-std", "rust.debug-assertions-std", "build the standard library with debugging assertions") o("overflow-checks", "rust.overflow-checks", "build with overflow checks") +o("overflow-checks-std", "rust.overflow-checks-std", "build the standard library with overflow checks") o("llvm-release-debuginfo", "llvm.release-debuginfo", "build LLVM with debugger metadata") v("debuginfo-level", "rust.debuginfo-level", "debuginfo level for Rust code") v("debuginfo-level-rustc", "rust.debuginfo-level-rustc", "debuginfo level for the compiler") diff --git a/src/librustdoc/html/render/write_shared.rs b/src/librustdoc/html/render/write_shared.rs index c1a83ad5820..e4c2556118a 100644 --- a/src/librustdoc/html/render/write_shared.rs +++ b/src/librustdoc/html/render/write_shared.rs @@ -39,8 +39,9 @@ static FILES_UNVERSIONED: Lazy<FxHashMap<&str, &[u8]>> = Lazy::new(|| { "SourceCodePro-Semibold.ttf.woff" => static_files::source_code_pro::SEMIBOLD, "SourceCodePro-It.ttf.woff" => static_files::source_code_pro::ITALIC, "SourceCodePro-LICENSE.txt" => static_files::source_code_pro::LICENSE, - "noto-sans-kr-v13-korean-regular.woff" => static_files::noto_sans_kr::REGULAR, - "noto-sans-kr-v13-korean-regular-LICENSE.txt" => static_files::noto_sans_kr::LICENSE, + "noto-sans-kr-regular.woff2" => static_files::noto_sans_kr::REGULAR2, + "noto-sans-kr-regular.woff" => static_files::noto_sans_kr::REGULAR, + "noto-sans-kr-LICENSE.txt" => static_files::noto_sans_kr::LICENSE, "LICENSE-MIT.txt" => static_files::LICENSE_MIT, "LICENSE-APACHE.txt" => static_files::LICENSE_APACHE, "COPYRIGHT.txt" => static_files::COPYRIGHT, diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 962af66368d..11c54876dea 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -75,12 +75,13 @@ font-display: swap; } -/* Avoid using legacy CJK serif fonts in Windows like Batang */ +/* Avoid using legacy CJK serif fonts in Windows like Batang. */ @font-face { font-family: 'Noto Sans KR'; - src: url("noto-sans-kr-v13-korean-regular.woff") format("woff"); + src: url("noto-sans-kr-regular.woff2") format("woff2"), + url("noto-sans-kr-regular.woff") format("woff"); font-display: swap; - unicode-range: U+A960-A97F, U+AC00-D7AF, U+D7B0-D7FF; + unicode-range: U+AC00-D7AF, U+3130-318F, U+1100-11FF, U+A960-A97F, U+D7B0-D7FF; } * { diff --git a/src/librustdoc/html/static/fonts/noto-sans-kr-v13-korean-regular-LICENSE.txt b/src/librustdoc/html/static/fonts/noto-sans-kr-LICENSE.txt index 922d5fdc18d..922d5fdc18d 100644 --- a/src/librustdoc/html/static/fonts/noto-sans-kr-v13-korean-regular-LICENSE.txt +++ b/src/librustdoc/html/static/fonts/noto-sans-kr-LICENSE.txt diff --git a/src/librustdoc/html/static/fonts/noto-sans-kr-v13-korean-regular.woff b/src/librustdoc/html/static/fonts/noto-sans-kr-regular.woff index 01d6b6b5466..65e939c6b9f 100644 --- a/src/librustdoc/html/static/fonts/noto-sans-kr-v13-korean-regular.woff +++ b/src/librustdoc/html/static/fonts/noto-sans-kr-regular.woff Binary files differdiff --git a/src/librustdoc/html/static/fonts/noto-sans-kr-regular.woff2 b/src/librustdoc/html/static/fonts/noto-sans-kr-regular.woff2 new file mode 100644 index 00000000000..8126492e41d --- /dev/null +++ b/src/librustdoc/html/static/fonts/noto-sans-kr-regular.woff2 Binary files differdiff --git a/src/librustdoc/html/static_files.rs b/src/librustdoc/html/static_files.rs index ccc25e6cc49..924e3f1d29d 100644 --- a/src/librustdoc/html/static_files.rs +++ b/src/librustdoc/html/static_files.rs @@ -157,15 +157,14 @@ crate mod source_code_pro { } crate mod noto_sans_kr { - /// The file `noto-sans-kr-v13-korean-regular.woff`, the Regular variant of the Noto Sans KR - /// font. - crate static REGULAR: &[u8] = - include_bytes!("static/fonts/noto-sans-kr-v13-korean-regular.woff"); + /// The file `noto-sans-kr.woff`, the Regular variant of the Noto Sans KR font. + crate static REGULAR: &[u8] = include_bytes!("static/fonts/noto-sans-kr-regular.woff"); - /// The file `noto-sans-kr-v13-korean-regular-LICENSE.txt`, the license text of the Noto Sans KR - /// font. - crate static LICENSE: &[u8] = - include_bytes!("static/fonts/noto-sans-kr-v13-korean-regular-LICENSE.txt"); + /// The file `noto-sans-kr.woff2`, the Regular variant of the Noto Sans KR font. + crate static REGULAR2: &[u8] = include_bytes!("static/fonts/noto-sans-kr-regular.woff2"); + + /// The file `noto-sans-kr-LICENSE.txt`, the license text of the Noto Sans KR font. + crate static LICENSE: &[u8] = include_bytes!("static/fonts/noto-sans-kr-LICENSE.txt"); } /// Files related to the sidebar in rustdoc sources. diff --git a/src/test/ui/consts/issue-88071.rs b/src/test/ui/consts/issue-88071.rs new file mode 100644 index 00000000000..a2d4a642128 --- /dev/null +++ b/src/test/ui/consts/issue-88071.rs @@ -0,0 +1,21 @@ +// check-pass +// +// regression test for #88071 + +#![feature(const_btree_new)] +#![feature(const_fn_trait_bound)] + +use std::collections::BTreeMap; + +pub struct CustomMap<K, V>(BTreeMap<K, V>); + +impl<K, V> CustomMap<K, V> +where + K: Ord, +{ + pub const fn new() -> Self { + CustomMap(BTreeMap::new()) + } +} + +fn main() {} diff --git a/src/test/ui/generic-associated-types/issue-87750.rs b/src/test/ui/generic-associated-types/issue-87750.rs new file mode 100644 index 00000000000..89bd79ac299 --- /dev/null +++ b/src/test/ui/generic-associated-types/issue-87750.rs @@ -0,0 +1,22 @@ +#![feature(generic_associated_types)] + +trait PointerFamily { + type Pointer<T>; +} + +struct Rc<T>(Box<T>); +struct RcFamily; + +impl PointerFamily for RcFamily { + type Pointer<T> = Rc<T>; +} + +#[allow(dead_code)] +enum Node<T, P: PointerFamily> where P::Pointer<Node<T, P>>: Sized { + Cons(P::Pointer<Node<T, P>>), +} + +fn main() { + let _list: <RcFamily as PointerFamily>::Pointer<Node<i32, RcFamily>>; + //~^ ERROR overflow evaluating the requirement `Node<i32, RcFamily>: Sized` +} diff --git a/src/test/ui/generic-associated-types/issue-87750.stderr b/src/test/ui/generic-associated-types/issue-87750.stderr new file mode 100644 index 00000000000..854541f3d8f --- /dev/null +++ b/src/test/ui/generic-associated-types/issue-87750.stderr @@ -0,0 +1,9 @@ +error[E0275]: overflow evaluating the requirement `Node<i32, RcFamily>: Sized` + --> $DIR/issue-87750.rs:20:16 + | +LL | let _list: <RcFamily as PointerFamily>::Pointer<Node<i32, RcFamily>>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0275`. diff --git a/src/test/ui/pattern/bindings-after-at/nested-type-ascription-syntactically-invalid.rs b/src/test/ui/pattern/bindings-after-at/nested-type-ascription-syntactically-invalid.rs index 5c7769ce604..a709e34b501 100644 --- a/src/test/ui/pattern/bindings-after-at/nested-type-ascription-syntactically-invalid.rs +++ b/src/test/ui/pattern/bindings-after-at/nested-type-ascription-syntactically-invalid.rs @@ -1,5 +1,5 @@ // Here we check that type ascription is syntactically invalid when -// not in the top position of a ascribing a let binding or function parameter. +// not in the top position of an ascribing `let` binding or function parameter. // This has no effect. diff --git a/src/test/ui/traits/issue-52893.rs b/src/test/ui/traits/issue-52893.rs new file mode 100644 index 00000000000..d72598d5d59 --- /dev/null +++ b/src/test/ui/traits/issue-52893.rs @@ -0,0 +1,57 @@ +// check-fail +// +// regression test for issue 52893 +trait At<Name> { + type AtRes; + fn at(self) -> Self::AtRes; +} + +trait Push<T> { + type PushRes; + fn push(self, other: T) -> Self::PushRes; +} + +trait AddClass<Name, F> { + type AddRes; + fn init(self, func: F); +} + +trait ToRef { + type RefRes; + fn to_ref(&self) -> Self::RefRes; +} + +struct Class<P>(P); + +impl<P> Class<P> { + fn with<Name, F>(self) -> <Self as AddClass<Name, F>>::AddRes + where + Self: AddClass<Name, F>, + { + todo!() + } + + fn from<F>(self) -> <Self as AddClass<P, F>>::AddRes + where + Self: AddClass<P, F>, + { + todo!() + } +} + +impl<F, Name, P> AddClass<Name, F> for Class<P> +where + Self: At<Name>, + <Self as At<Name>>::AtRes: Push<F>, + <<Self as At<Name>>::AtRes as Push<F>>::PushRes: ToRef<RefRes = Self> + Push<F>, +{ + type AddRes = (); + + fn init(self, func: F) { + let builder = self.at().push(func); + let output = builder.to_ref(); + builder.push(output); //~ ERROR mismatched types [E0308] + } +} + +fn main() {} diff --git a/src/test/ui/traits/issue-52893.stderr b/src/test/ui/traits/issue-52893.stderr new file mode 100644 index 00000000000..bf732e24915 --- /dev/null +++ b/src/test/ui/traits/issue-52893.stderr @@ -0,0 +1,15 @@ +error[E0308]: mismatched types + --> $DIR/issue-52893.rs:53:22 + | +LL | impl<F, Name, P> AddClass<Name, F> for Class<P> + | - this type parameter +... +LL | builder.push(output); + | ^^^^^^ expected type parameter `F`, found struct `Class` + | + = note: expected type parameter `F` + found struct `Class<P>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/traits/issue-68295.rs b/src/test/ui/traits/issue-68295.rs new file mode 100644 index 00000000000..7ff54539adc --- /dev/null +++ b/src/test/ui/traits/issue-68295.rs @@ -0,0 +1,47 @@ +// check-fail +// +// regression test for #68295 + +struct Matrix<R, C, S>(R, C, S); + +impl<R, C, S> Matrix<R, C, S> { + fn into_owned(self) -> Matrix<R, C, Owned<R, C, ()>> + where + (): Allocator<R, C>, + { + unimplemented!() + } +} + +impl<D, S> Matrix<D, D, S> { + fn hermitian_part(&self) -> Matrix<D, D, Owned<D, D, ()>> + where + (): Allocator<D, D>, + { + unimplemented!() + } +} + +trait Allocator<R, C> { + type Buffer; +} + +trait Trait<R, C, A> { + type Power; +} + +impl<R, C, A: Allocator<R, C>> Trait<R, C, A> for () { + type Power = A::Buffer; +} + +type Owned<R, C, G> = <G as Trait<R, C, ()>>::Power; + +fn crash<R, C>(input: Matrix<R, C, ()>) -> Matrix<R, C, u32> +where + (): Allocator<R, C>, +{ + input.into_owned() + //~^ ERROR mismatched types [E0308] +} + +fn main() {} diff --git a/src/test/ui/traits/issue-68295.stderr b/src/test/ui/traits/issue-68295.stderr new file mode 100644 index 00000000000..cb6e6e0769c --- /dev/null +++ b/src/test/ui/traits/issue-68295.stderr @@ -0,0 +1,17 @@ +error[E0308]: mismatched types + --> $DIR/issue-68295.rs:43:5 + | +LL | fn crash<R, C>(input: Matrix<R, C, ()>) -> Matrix<R, C, u32> + | ----------------- expected `Matrix<R, C, u32>` because of return type +... +LL | input.into_owned() + | ^^^^^^^^^^^^^^^^^^ expected `u32`, found associated type + | + = note: expected struct `Matrix<_, _, u32>` + found struct `Matrix<_, _, <() as Allocator<R, C>>::Buffer>` + = help: consider constraining the associated type `<() as Allocator<R, C>>::Buffer` to `u32` + = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. |
