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
This commit is contained in:
bors 2021-10-13 13:41:48 +00:00
commit 81117ff930
29 changed files with 278 additions and 25 deletions

View file

@ -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);

View file

@ -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")

View file

@ -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,

View file

@ -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;
}
* {

View file

@ -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.

View file

@ -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() {}

View file

@ -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`
}

View file

@ -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`.

View file

@ -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.

View file

@ -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() {}

View file

@ -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`.

View file

@ -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() {}

View file

@ -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`.