Auto merge of #96414 - Dylan-DPC:rollup-t4ofhoa, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #90312 (Fix some confusing wording and improve slice-search-related docs)
 - #96149 (Remove unused macro rules)
 - #96279 (rustdoc: Remove .woff font files)
 - #96355 (Better handle too many `#` recovery in raw str)
 - #96379 (delay bug when adjusting `NeverToAny` twice during diagnostic code)
 - #96384 (do not consider two extern types to be similar)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2022-04-26 01:52:46 +00:00
commit 9ea4d4127f
33 changed files with 244 additions and 177 deletions

View file

@ -255,19 +255,6 @@ impl EmissionGuarantee for ! {
/// instead of a `&DiagnosticBuilder<'a>`. This `forward!` macro makes
/// it easy to declare such methods on the builder.
macro_rules! forward {
// Forward pattern for &self -> &Self
(
$(#[$attrs:meta])*
pub fn $n:ident(&self, $($name:ident: $ty:ty),* $(,)?) -> &Self
) => {
$(#[$attrs])*
#[doc = concat!("See [`Diagnostic::", stringify!($n), "()`].")]
pub fn $n(&self, $($name: $ty),*) -> &Self {
self.diagnostic.$n($($name),*);
self
}
};
// Forward pattern for &mut self -> &mut Self
(
$(#[$attrs:meta])*

View file

@ -453,9 +453,6 @@ macro_rules! impl_arena_allocatable_decoder {
}
}
};
([$ignore:ident $(, $attrs:ident)*]$args:tt) => {
impl_arena_allocatable_decoder!([$($attrs),*]$args);
};
}
macro_rules! impl_arena_allocatable_decoders {

View file

@ -431,10 +431,11 @@ impl<'a> Parser<'a> {
return Ok(true);
} else if self.look_ahead(0, |t| {
t == &token::CloseDelim(token::Brace)
|| (
t.can_begin_expr() && t != &token::Semi && t != &token::Pound
// Avoid triggering with too many trailing `#` in raw string.
)
|| (t.can_begin_expr() && t != &token::Semi && t != &token::Pound)
// Avoid triggering with too many trailing `#` in raw string.
|| (sm.is_multiline(
self.prev_token.span.shrink_to_hi().until(self.token.span.shrink_to_lo())
) && t == &token::Pound)
}) {
// Missing semicolon typo. This is triggered if the next token could either start a
// new statement or is a block close. For example:
@ -508,7 +509,12 @@ impl<'a> Parser<'a> {
}
if self.check_too_many_raw_str_terminators(&mut err) {
return Err(err);
if expected.contains(&TokenType::Token(token::Semi)) && self.eat(&token::Semi) {
err.emit();
return Ok(true);
} else {
return Err(err);
}
}
if self.prev_token.span == DUMMY_SP {
@ -538,6 +544,7 @@ impl<'a> Parser<'a> {
}
fn check_too_many_raw_str_terminators(&mut self, err: &mut Diagnostic) -> bool {
let sm = self.sess.source_map();
match (&self.prev_token.kind, &self.token.kind) {
(
TokenKind::Literal(Lit {
@ -545,15 +552,33 @@ impl<'a> Parser<'a> {
..
}),
TokenKind::Pound,
) => {
) if !sm.is_multiline(
self.prev_token.span.shrink_to_hi().until(self.token.span.shrink_to_lo()),
) =>
{
let n_hashes: u8 = *n_hashes;
err.set_primary_message("too many `#` when terminating raw string");
let str_span = self.prev_token.span;
let mut span = self.token.span;
let mut count = 0;
while self.token.kind == TokenKind::Pound
&& !sm.is_multiline(span.shrink_to_hi().until(self.token.span.shrink_to_lo()))
{
span = span.with_hi(self.token.span.hi());
self.bump();
count += 1;
}
err.set_span(span);
err.span_suggestion(
self.token.span,
"remove the extra `#`",
span,
&format!("remove the extra `#`{}", pluralize!(count)),
String::new(),
Applicability::MachineApplicable,
);
err.note(&format!("the raw string started with {n_hashes} `#`s"));
err.span_label(
str_span,
&format!("this raw string started with {n_hashes} `#`{}", pluralize!(n_hashes)),
);
true
}
_ => false,

View file

@ -498,7 +498,6 @@ macro_rules! peel {
/// Therefore, the recursion depth is the binary logarithm of the number of
/// tokens to count, and the expanded tree is likewise very small.
macro_rules! count {
() => (0usize);
($one:tt) => (1usize);
($($pairs:tt $_p:tt)*) => (count!($($pairs)*) << 1usize);
($odd:tt $($rest:tt)*) => (count!($($rest)*) | 1usize);

View file

@ -2249,10 +2249,6 @@ impl ToJson for Target {
let name = (stringify!($attr)).replace("_", "-");
d.insert(name, self.$attr.to_json());
}};
($attr:ident, $key_name:expr) => {{
let name = $key_name;
d.insert(name.into(), self.$attr.to_json());
}};
}
macro_rules! target_option_val {

View file

@ -1727,6 +1727,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
} else if cat_a == cat_b {
match (a.kind(), b.kind()) {
(ty::Adt(def_a, _), ty::Adt(def_b, _)) => def_a == def_b,
(ty::Foreign(def_a), ty::Foreign(def_b)) => def_a == def_b,
// Matching on references results in a lot of unhelpful
// suggestions, so let's just not do that for now.
//

View file

@ -78,10 +78,18 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// While we don't allow *arbitrary* coercions here, we *do* allow
// coercions from ! to `expected`.
if ty.is_never() {
assert!(
!self.typeck_results.borrow().adjustments().contains_key(expr.hir_id),
"expression with never type wound up being adjusted"
);
if let Some(adjustments) = self.typeck_results.borrow().adjustments().get(expr.hir_id) {
self.tcx().sess.delay_span_bug(
expr.span,
"expression with never type wound up being adjusted",
);
return if let [Adjustment { kind: Adjust::NeverToAny, target }] = &adjustments[..] {
target.to_owned()
} else {
self.tcx().ty_error()
};
}
let adj_ty = self.next_ty_var(TypeVariableOrigin {
kind: TypeVariableOriginKind::AdjustmentType,
span: expr.span,

View file

@ -645,7 +645,7 @@ impl<T> LinkedList<T> {
/// Returns `true` if the `LinkedList` contains an element equal to the
/// given value.
///
/// This operation should compute in *O*(*n*) time.
/// This operation should compute linearly in *O*(*n*) time.
///
/// # Examples
///
@ -1569,7 +1569,7 @@ impl<'a, T> CursorMut<'a, T> {
/// Appends an element to the front of the cursor's parent list. The node
/// that the cursor points to is unchanged, even if it is the "ghost" node.
///
/// This operation should compute in O(1) time.
/// This operation should compute in *O*(1) time.
// `push_front` continues to point to "ghost" when it addes a node to mimic
// the behavior of `insert_before` on an empty list.
#[unstable(feature = "linked_list_cursors", issue = "58533")]
@ -1584,7 +1584,7 @@ impl<'a, T> CursorMut<'a, T> {
/// Appends an element to the back of the cursor's parent list. The node
/// that the cursor points to is unchanged, even if it is the "ghost" node.
///
/// This operation should compute in O(1) time.
/// This operation should compute in *O*(1) time.
#[unstable(feature = "linked_list_cursors", issue = "58533")]
pub fn push_back(&mut self, elt: T) {
// Safety: We know that `push_back` does not change the position in
@ -1603,7 +1603,7 @@ impl<'a, T> CursorMut<'a, T> {
/// unchanged, unless it was pointing to the front element. In that case, it
/// points to the new front element.
///
/// This operation should compute in O(1) time.
/// This operation should compute in *O*(1) time.
#[unstable(feature = "linked_list_cursors", issue = "58533")]
pub fn pop_front(&mut self) -> Option<T> {
// We can't check if current is empty, we must check the list directly.
@ -1630,7 +1630,7 @@ impl<'a, T> CursorMut<'a, T> {
/// unchanged, unless it was pointing to the back element. In that case, it
/// points to the "ghost" element.
///
/// This operation should compute in O(1) time.
/// This operation should compute in *O*(1) time.
#[unstable(feature = "linked_list_cursors", issue = "58533")]
pub fn pop_back(&mut self) -> Option<T> {
if self.list.is_empty() {

View file

@ -1342,6 +1342,12 @@ impl<T, A: Allocator> VecDeque<T, A> {
/// Returns `true` if the deque contains an element equal to the
/// given value.
///
/// This operation is *O*(*n*).
///
/// Note that if you have a sorted `VecDeque`, [`binary_search`] may be faster.
///
/// [`binary_search`]: VecDeque::binary_search
///
/// # Examples
///
/// ```
@ -2560,7 +2566,8 @@ impl<T, A: Allocator> VecDeque<T, A> {
}
}
/// Binary searches the sorted deque for a given element.
/// Binary searches this `VecDeque` for a given element.
/// This behaves similarly to [`contains`] if this `VecDeque` is sorted.
///
/// If the value is found then [`Result::Ok`] is returned, containing the
/// index of the matching element. If there are multiple matches, then any
@ -2570,6 +2577,7 @@ impl<T, A: Allocator> VecDeque<T, A> {
///
/// See also [`binary_search_by`], [`binary_search_by_key`], and [`partition_point`].
///
/// [`contains`]: VecDeque::contains
/// [`binary_search_by`]: VecDeque::binary_search_by
/// [`binary_search_by_key`]: VecDeque::binary_search_by_key
/// [`partition_point`]: VecDeque::partition_point
@ -2614,7 +2622,8 @@ impl<T, A: Allocator> VecDeque<T, A> {
self.binary_search_by(|e| e.cmp(x))
}
/// Binary searches the sorted deque with a comparator function.
/// Binary searches this `VecDeque` with a comparator function.
/// This behaves similarly to [`contains`] if this `VecDeque` is sorted.
///
/// The comparator function should implement an order consistent
/// with the sort order of the deque, returning an order code that
@ -2629,6 +2638,7 @@ impl<T, A: Allocator> VecDeque<T, A> {
///
/// See also [`binary_search`], [`binary_search_by_key`], and [`partition_point`].
///
/// [`contains`]: VecDeque::contains
/// [`binary_search`]: VecDeque::binary_search
/// [`binary_search_by_key`]: VecDeque::binary_search_by_key
/// [`partition_point`]: VecDeque::partition_point
@ -2667,7 +2677,8 @@ impl<T, A: Allocator> VecDeque<T, A> {
}
}
/// Binary searches the sorted deque with a key extraction function.
/// Binary searches this `VecDeque` with a key extraction function.
/// This behaves similarly to [`contains`] if this `VecDeque` is sorted.
///
/// Assumes that the deque is sorted by the key, for instance with
/// [`make_contiguous().sort_by_key()`] using the same key extraction function.
@ -2680,6 +2691,7 @@ impl<T, A: Allocator> VecDeque<T, A> {
///
/// See also [`binary_search`], [`binary_search_by`], and [`partition_point`].
///
/// [`contains`]: VecDeque::contains
/// [`make_contiguous().sort_by_key()`]: VecDeque::make_contiguous
/// [`binary_search`]: VecDeque::binary_search
/// [`binary_search_by`]: VecDeque::binary_search_by

View file

@ -1,10 +1,6 @@
// implements the unary operator "op &T"
// based on "op T" where T is expected to be `Copy`able
macro_rules! forward_ref_unop {
(impl $imp:ident, $method:ident for $t:ty) => {
forward_ref_unop!(impl $imp, $method for $t,
#[stable(feature = "rust1", since = "1.0.0")]);
};
(impl const $imp:ident, $method:ident for $t:ty) => {
forward_ref_unop!(impl const $imp, $method for $t,
#[stable(feature = "rust1", since = "1.0.0")]);
@ -38,10 +34,6 @@ macro_rules! forward_ref_unop {
// implements binary operators "&T op U", "T op &U", "&T op &U"
// based on "T op U" where T and U are expected to be `Copy`able
macro_rules! forward_ref_binop {
(impl $imp:ident, $method:ident for $t:ty, $u:ty) => {
forward_ref_binop!(impl $imp, $method for $t, $u,
#[stable(feature = "rust1", since = "1.0.0")]);
};
(impl const $imp:ident, $method:ident for $t:ty, $u:ty) => {
forward_ref_binop!(impl const $imp, $method for $t, $u,
#[stable(feature = "rust1", since = "1.0.0")]);
@ -230,22 +222,6 @@ macro_rules! cfg_if {
}
};
// match if/else chains lacking a final `else`
(
if #[cfg( $i_meta:meta )] { $( $i_tokens:tt )* }
$(
else if #[cfg( $e_meta:meta )] { $( $e_tokens:tt )* }
)*
) => {
cfg_if! {
@__items () ;
(( $i_meta ) ( $( $i_tokens )* )) ,
$(
(( $e_meta ) ( $( $e_tokens )* )) ,
)*
}
};
// Internal and recursive macro to emit all the items
//
// Collects all the previous cfgs in a list at the beginning, so they can be

View file

@ -2139,6 +2139,12 @@ impl<T> [T] {
/// Returns `true` if the slice contains an element with the given value.
///
/// This operation is *O*(*n*).
///
/// Note that if you have a sorted slice, [`binary_search`] may be faster.
///
/// [`binary_search`]: slice::binary_search
///
/// # Examples
///
/// ```
@ -2298,7 +2304,8 @@ impl<T> [T] {
None
}
/// Binary searches this sorted slice for a given element.
/// Binary searches this slice for a given element.
/// This behaves similary to [`contains`] if this slice is sorted.
///
/// If the value is found then [`Result::Ok`] is returned, containing the
/// index of the matching element. If there are multiple matches, then any
@ -2310,6 +2317,7 @@ impl<T> [T] {
///
/// See also [`binary_search_by`], [`binary_search_by_key`], and [`partition_point`].
///
/// [`contains`]: slice::contains
/// [`binary_search_by`]: slice::binary_search_by
/// [`binary_search_by_key`]: slice::binary_search_by_key
/// [`partition_point`]: slice::partition_point
@ -2349,7 +2357,8 @@ impl<T> [T] {
self.binary_search_by(|p| p.cmp(x))
}
/// Binary searches this sorted slice with a comparator function.
/// Binary searches this slice with a comparator function.
/// This behaves similarly to [`contains`] if this slice is sorted.
///
/// The comparator function should implement an order consistent
/// with the sort order of the underlying slice, returning an
@ -2366,6 +2375,7 @@ impl<T> [T] {
///
/// See also [`binary_search`], [`binary_search_by_key`], and [`partition_point`].
///
/// [`contains`]: slice::contains
/// [`binary_search`]: slice::binary_search
/// [`binary_search_by_key`]: slice::binary_search_by_key
/// [`partition_point`]: slice::partition_point
@ -2424,7 +2434,8 @@ impl<T> [T] {
Err(left)
}
/// Binary searches this sorted slice with a key extraction function.
/// Binary searches this slice with a key extraction function.
/// This behaves similarly to [`contains`] if this slice is sorted.
///
/// Assumes that the slice is sorted by the key, for instance with
/// [`sort_by_key`] using the same key extraction function.
@ -2439,6 +2450,7 @@ impl<T> [T] {
///
/// See also [`binary_search`], [`binary_search_by`], and [`partition_point`].
///
/// [`contains`]: slice::contains
/// [`sort_by_key`]: slice::sort_by_key
/// [`binary_search`]: slice::binary_search
/// [`binary_search_by`]: slice::binary_search_by

View file

@ -43,18 +43,6 @@ macro_rules! impls_defined {
}
macro_rules! test_op {
($fn_name:ident, $op:ident::$method:ident($lhs:literal, $rhs:literal), $result:literal, $($t:ty),+) => {
#[test]
fn $fn_name() {
impls_defined!($op, $method($lhs, $rhs), $result, $($t),+);
}
};
($fn_name:ident, $op:ident::$method:ident(&mut $lhs:literal, $rhs:literal), $result:literal, $($t:ty),+) => {
#[test]
fn $fn_name() {
impls_defined!($op, $method(&mut $lhs, $rhs), $result, $($t),+);
}
};
($fn_name:ident, $op:ident::$method:ident($lhs:literal), $result:literal, $($t:ty),+) => {
#[test]
fn $fn_name() {

View file

@ -12,7 +12,6 @@ macro_rules! quote_tt {
({$($t:tt)*}) => { Group::new(Delimiter::Brace, quote!($($t)*)) };
(,) => { Punct::new(',', Spacing::Alone) };
(.) => { Punct::new('.', Spacing::Alone) };
(:) => { Punct::new(':', Spacing::Alone) };
(;) => { Punct::new(';', Spacing::Alone) };
(!) => { Punct::new('!', Spacing::Alone) };
(<) => { Punct::new('<', Spacing::Alone) };

View file

@ -21,27 +21,18 @@ use crate::{try_err, try_none};
static FILES_UNVERSIONED: Lazy<FxHashMap<&str, &[u8]>> = Lazy::new(|| {
map! {
"FiraSans-Regular.woff2" => static_files::fira_sans::REGULAR2,
"FiraSans-Medium.woff2" => static_files::fira_sans::MEDIUM2,
"FiraSans-Regular.woff" => static_files::fira_sans::REGULAR,
"FiraSans-Medium.woff" => static_files::fira_sans::MEDIUM,
"FiraSans-Regular.woff2" => static_files::fira_sans::REGULAR,
"FiraSans-Medium.woff2" => static_files::fira_sans::MEDIUM,
"FiraSans-LICENSE.txt" => static_files::fira_sans::LICENSE,
"SourceSerif4-Regular.ttf.woff2" => static_files::source_serif_4::REGULAR2,
"SourceSerif4-Bold.ttf.woff2" => static_files::source_serif_4::BOLD2,
"SourceSerif4-It.ttf.woff2" => static_files::source_serif_4::ITALIC2,
"SourceSerif4-Regular.ttf.woff" => static_files::source_serif_4::REGULAR,
"SourceSerif4-Bold.ttf.woff" => static_files::source_serif_4::BOLD,
"SourceSerif4-It.ttf.woff" => static_files::source_serif_4::ITALIC,
"SourceSerif4-Regular.ttf.woff2" => static_files::source_serif_4::REGULAR,
"SourceSerif4-Bold.ttf.woff2" => static_files::source_serif_4::BOLD,
"SourceSerif4-It.ttf.woff2" => static_files::source_serif_4::ITALIC,
"SourceSerif4-LICENSE.md" => static_files::source_serif_4::LICENSE,
"SourceCodePro-Regular.ttf.woff2" => static_files::source_code_pro::REGULAR2,
"SourceCodePro-Semibold.ttf.woff2" => static_files::source_code_pro::SEMIBOLD2,
"SourceCodePro-It.ttf.woff2" => static_files::source_code_pro::ITALIC2,
"SourceCodePro-Regular.ttf.woff" => static_files::source_code_pro::REGULAR,
"SourceCodePro-Semibold.ttf.woff" => static_files::source_code_pro::SEMIBOLD,
"SourceCodePro-It.ttf.woff" => static_files::source_code_pro::ITALIC,
"SourceCodePro-Regular.ttf.woff2" => static_files::source_code_pro::REGULAR,
"SourceCodePro-Semibold.ttf.woff2" => static_files::source_code_pro::SEMIBOLD,
"SourceCodePro-It.ttf.woff2" => static_files::source_code_pro::ITALIC,
"SourceCodePro-LICENSE.txt" => static_files::source_code_pro::LICENSE,
"NanumBarunGothic.ttf.woff2" => static_files::nanum_barun_gothic::REGULAR2,
"NanumBarunGothic.ttf.woff" => static_files::nanum_barun_gothic::REGULAR,
"NanumBarunGothic.ttf.woff2" => static_files::nanum_barun_gothic::REGULAR,
"NanumBarunGothic-LICENSE.txt" => static_files::nanum_barun_gothic::LICENSE,
"LICENSE-MIT.txt" => static_files::LICENSE_MIT,
"LICENSE-APACHE.txt" => static_files::LICENSE_APACHE,

View file

@ -2,8 +2,7 @@ These documentation pages include resources by third parties. This copyright
file applies only to those resources. The following third party resources are
included, and carry their own copyright notices and license terms:
* Fira Sans (FiraSans-Regular.woff2, FiraSans-Medium.woff2,
FiraSans-Regular.woff, FiraSans-Medium.woff):
* Fira Sans (FiraSans-Regular.woff2, FiraSans-Medium.woff2):
Copyright (c) 2014, Mozilla Foundation https://mozilla.org/
with Reserved Font Name Fira Sans.
@ -25,9 +24,7 @@ included, and carry their own copyright notices and license terms:
Licensed under the MIT license (see LICENSE-MIT.txt).
* Source Code Pro (SourceCodePro-Regular.ttf.woff2,
SourceCodePro-Semibold.ttf.woff2, SourceCodePro-It.ttf.woff2,
SourceCodePro-Regular.ttf.woff, SourceCodePro-Semibold.ttf.woff,
SourceCodePro-It.ttf.woff):
SourceCodePro-Semibold.ttf.woff2, SourceCodePro-It.ttf.woff2):
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/),
with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark
@ -37,8 +34,7 @@ included, and carry their own copyright notices and license terms:
See SourceCodePro-LICENSE.txt.
* Source Serif 4 (SourceSerif4-Regular.ttf.woff2, SourceSerif4-Bold.ttf.woff2,
SourceSerif4-It.ttf.woff2, SourceSerif4-Regular.ttf.woff,
SourceSerif4-Bold.ttf.woff, SourceSerif4-It.ttf.woff):
SourceSerif4-It.ttf.woff2):
Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name
'Source'. All Rights Reserved. Source is a trademark of Adobe in the United

View file

@ -4,8 +4,7 @@
font-style: normal;
font-weight: 400;
src: local('Fira Sans'),
url("FiraSans-Regular.woff2") format("woff2"),
url("FiraSans-Regular.woff") format('woff');
url("FiraSans-Regular.woff2") format("woff2");
font-display: swap;
}
@font-face {
@ -13,8 +12,7 @@
font-style: normal;
font-weight: 500;
src: local('Fira Sans Medium'),
url("FiraSans-Medium.woff2") format("woff2"),
url("FiraSans-Medium.woff") format('woff');
url("FiraSans-Medium.woff2") format("woff2");
font-display: swap;
}
@ -24,8 +22,7 @@
font-style: normal;
font-weight: 400;
src: local('Source Serif 4'),
url("SourceSerif4-Regular.ttf.woff2") format("woff2"),
url("SourceSerif4-Regular.ttf.woff") format("woff");
url("SourceSerif4-Regular.ttf.woff2") format("woff2");
font-display: swap;
}
@font-face {
@ -33,8 +30,7 @@
font-style: italic;
font-weight: 400;
src: local('Source Serif 4 Italic'),
url("SourceSerif4-It.ttf.woff2") format("woff2"),
url("SourceSerif4-It.ttf.woff") format("woff");
url("SourceSerif4-It.ttf.woff2") format("woff2");
font-display: swap;
}
@font-face {
@ -42,8 +38,7 @@
font-style: normal;
font-weight: 700;
src: local('Source Serif 4 Bold'),
url("SourceSerif4-Bold.ttf.woff2") format("woff2"),
url("SourceSerif4-Bold.ttf.woff") format("woff");
url("SourceSerif4-Bold.ttf.woff2") format("woff2");
font-display: swap;
}
@ -54,32 +49,28 @@
font-weight: 400;
/* Avoid using locally installed font because bad versions are in circulation:
* see https://github.com/rust-lang/rust/issues/24355 */
src: url("SourceCodePro-Regular.ttf.woff2") format("woff2"),
url("SourceCodePro-Regular.ttf.woff") format("woff");
src: url("SourceCodePro-Regular.ttf.woff2") format("woff2");
font-display: swap;
}
@font-face {
font-family: 'Source Code Pro';
font-style: italic;
font-weight: 400;
src: url("SourceCodePro-It.ttf.woff2") format("woff2"),
url("SourceCodePro-It.ttf.woff") format("woff");
src: url("SourceCodePro-It.ttf.woff2") format("woff2");
font-display: swap;
}
@font-face {
font-family: 'Source Code Pro';
font-style: normal;
font-weight: 600;
src: url("SourceCodePro-Semibold.ttf.woff2") format("woff2"),
url("SourceCodePro-Semibold.ttf.woff") format("woff");
src: url("SourceCodePro-Semibold.ttf.woff2") format("woff2");
font-display: swap;
}
/* Avoid using legacy CJK serif fonts in Windows like Batang. */
@font-face {
font-family: 'NanumBarunGothic';
src: url("NanumBarunGothic.ttf.woff2") format("woff2"),
url("NanumBarunGothic.ttf.woff") format("woff");
src: url("NanumBarunGothic.ttf.woff2") format("woff2");
font-display: swap;
unicode-range: U+AC00-D7AF, U+1100-11FF, U+3130-318F, U+A960-A97F, U+D7B0-D7FF;
}

View file

@ -92,17 +92,11 @@ crate mod themes {
/// Files related to the Fira Sans font.
crate mod fira_sans {
/// The file `FiraSans-Regular.woff`, the Regular variant of the Fira Sans font.
crate static REGULAR: &[u8] = include_bytes!("static/fonts/FiraSans-Regular.woff");
/// The file `FiraSans-Regular.woff2`, the Regular variant of the Fira Sans font in woff2.
crate static REGULAR2: &[u8] = include_bytes!("static/fonts/FiraSans-Regular.woff2");
/// The file `FiraSans-Medium.woff`, the Medium variant of the Fira Sans font.
crate static MEDIUM: &[u8] = include_bytes!("static/fonts/FiraSans-Medium.woff");
crate static REGULAR: &[u8] = include_bytes!("static/fonts/FiraSans-Regular.woff2");
/// The file `FiraSans-Medium.woff2`, the Medium variant of the Fira Sans font in woff2.
crate static MEDIUM2: &[u8] = include_bytes!("static/fonts/FiraSans-Medium.woff2");
crate static MEDIUM: &[u8] = include_bytes!("static/fonts/FiraSans-Medium.woff2");
/// The file `FiraSans-LICENSE.txt`, the license text for the Fira Sans font.
crate static LICENSE: &[u8] = include_bytes!("static/fonts/FiraSans-LICENSE.txt");
@ -110,26 +104,17 @@ crate mod fira_sans {
/// Files related to the Source Serif 4 font.
crate mod source_serif_4 {
/// The file `SourceSerif4-Regular.ttf.woff`, the Regular variant of the Source Serif 4 font.
crate static REGULAR: &[u8] = include_bytes!("static/fonts/SourceSerif4-Regular.ttf.woff");
/// The file `SourceSerif4-Regular.ttf.woff2`, the Regular variant of the Source Serif 4 font in
/// woff2.
crate static REGULAR2: &[u8] = include_bytes!("static/fonts/SourceSerif4-Regular.ttf.woff2");
/// The file `SourceSerif4-Bold.ttf.woff`, the Bold variant of the Source Serif 4 font.
crate static BOLD: &[u8] = include_bytes!("static/fonts/SourceSerif4-Bold.ttf.woff");
crate static REGULAR: &[u8] = include_bytes!("static/fonts/SourceSerif4-Regular.ttf.woff2");
/// The file `SourceSerif4-Bold.ttf.woff2`, the Bold variant of the Source Serif 4 font in
/// woff2.
crate static BOLD2: &[u8] = include_bytes!("static/fonts/SourceSerif4-Bold.ttf.woff2");
/// The file `SourceSerif4-It.ttf.woff`, the Italic variant of the Source Serif 4 font.
crate static ITALIC: &[u8] = include_bytes!("static/fonts/SourceSerif4-It.ttf.woff");
crate static BOLD: &[u8] = include_bytes!("static/fonts/SourceSerif4-Bold.ttf.woff2");
/// The file `SourceSerif4-It.ttf.woff2`, the Italic variant of the Source Serif 4 font in
/// woff2.
crate static ITALIC2: &[u8] = include_bytes!("static/fonts/SourceSerif4-It.ttf.woff2");
crate static ITALIC: &[u8] = include_bytes!("static/fonts/SourceSerif4-It.ttf.woff2");
/// The file `SourceSerif4-LICENSE.txt`, the license text for the Source Serif 4 font.
crate static LICENSE: &[u8] = include_bytes!("static/fonts/SourceSerif4-LICENSE.md");
@ -137,27 +122,17 @@ crate mod source_serif_4 {
/// Files related to the Source Code Pro font.
crate mod source_code_pro {
/// The file `SourceCodePro-Regular.ttf.woff`, the Regular variant of the Source Code Pro font.
crate static REGULAR: &[u8] = include_bytes!("static/fonts/SourceCodePro-Regular.ttf.woff");
/// The file `SourceCodePro-Regular.ttf.woff2`, the Regular variant of the Source Code Pro font
/// in woff2.
crate static REGULAR2: &[u8] = include_bytes!("static/fonts/SourceCodePro-Regular.ttf.woff2");
/// The file `SourceCodePro-Semibold.ttf.woff`, the Semibold variant of the Source Code Pro
/// font.
crate static SEMIBOLD: &[u8] = include_bytes!("static/fonts/SourceCodePro-Semibold.ttf.woff");
crate static REGULAR: &[u8] = include_bytes!("static/fonts/SourceCodePro-Regular.ttf.woff2");
/// The file `SourceCodePro-Semibold.ttf.woff2`, the Semibold variant of the Source Code Pro
/// font in woff2.
crate static SEMIBOLD2: &[u8] = include_bytes!("static/fonts/SourceCodePro-Semibold.ttf.woff2");
/// The file `SourceCodePro-It.ttf.woff`, the Italic variant of the Source Code Pro font.
crate static ITALIC: &[u8] = include_bytes!("static/fonts/SourceCodePro-It.ttf.woff");
crate static SEMIBOLD: &[u8] = include_bytes!("static/fonts/SourceCodePro-Semibold.ttf.woff2");
/// The file `SourceCodePro-It.ttf.woff2`, the Italic variant of the Source Code Pro font in
/// woff2.
crate static ITALIC2: &[u8] = include_bytes!("static/fonts/SourceCodePro-It.ttf.woff2");
crate static ITALIC: &[u8] = include_bytes!("static/fonts/SourceCodePro-It.ttf.woff2");
/// The file `SourceCodePro-LICENSE.txt`, the license text of the Source Code Pro font.
crate static LICENSE: &[u8] = include_bytes!("static/fonts/SourceCodePro-LICENSE.txt");
@ -176,19 +151,11 @@ crate mod source_code_pro {
/// ```sh
/// pyftsubset NanumBarunGothic.ttf \
/// --unicodes=U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF \
/// --output-file=NanumBarunGothic.ttf.woff --flavor=woff
/// ```
/// ```sh
/// pyftsubset NanumBarunGothic.ttf \
/// --unicodes=U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF \
/// --output-file=NanumBarunGothic.ttf.woff2 --flavor=woff2
/// ```
crate mod nanum_barun_gothic {
/// The file `NanumBarunGothic.ttf.woff`, the Regular variant of the Nanum Barun Gothic font.
crate static REGULAR: &[u8] = include_bytes!("static/fonts/NanumBarunGothic.ttf.woff");
/// The file `NanumBarunGothic.ttf.woff2`, the Regular variant of the Nanum Barun Gothic font.
crate static REGULAR2: &[u8] = include_bytes!("static/fonts/NanumBarunGothic.ttf.woff2");
crate static REGULAR: &[u8] = include_bytes!("static/fonts/NanumBarunGothic.ttf.woff2");
/// The file `NanumBarunGothic-LICENSE.txt`, the license text of the Nanum Barun Gothic font.
crate static LICENSE: &[u8] = include_bytes!("static/fonts/NanumBarunGothic-LICENSE.txt");

View file

@ -14,7 +14,7 @@ invocation-only:
[ -e $(INVOCATION_ONLY)/x/index.html ]
[ -e $(INVOCATION_ONLY)/theme-xxx.css ] # generated from z.css
! [ -e $(INVOCATION_ONLY)/storage-xxx.js ]
! [ -e $(INVOCATION_ONLY)/SourceSerif4-It.ttf.woff ]
! [ -e $(INVOCATION_ONLY)/SourceSerif4-It.ttf.woff2 ]
# FIXME: this probably shouldn't have a suffix
[ -e $(INVOCATION_ONLY)/y-xxx.css ]
@ -24,7 +24,7 @@ invocation-only:
toolchain-only:
$(RUSTDOC) -Z unstable-options --emit=toolchain-shared-resources --output $(TOOLCHAIN_ONLY) --resource-suffix=-xxx --extend-css z.css x.rs
[ -e $(TOOLCHAIN_ONLY)/storage-xxx.js ]
! [ -e $(TOOLCHAIN_ONLY)/SourceSerif4-It.ttf.woff ]
! [ -e $(TOOLCHAIN_ONLY)/SourceSerif4-It.ttf.woff2 ]
! [ -e $(TOOLCHAIN_ONLY)/search-index-xxx.js ]
! [ -e $(TOOLCHAIN_ONLY)/x/index.html ]
! [ -e $(TOOLCHAIN_ONLY)/theme.css ]
@ -35,7 +35,7 @@ toolchain-only:
all-shared:
$(RUSTDOC) -Z unstable-options --emit=toolchain-shared-resources,unversioned-shared-resources --output $(ALL_SHARED) --resource-suffix=-xxx --extend-css z.css x.rs
[ -e $(ALL_SHARED)/storage-xxx.js ]
[ -e $(ALL_SHARED)/SourceSerif4-It.ttf.woff ]
[ -e $(ALL_SHARED)/SourceSerif4-It.ttf.woff2 ]
! [ -e $(ALL_SHARED)/search-index-xxx.js ]
! [ -e $(ALL_SHARED)/settings.html ]
! [ -e $(ALL_SHARED)/x ]

View file

@ -0,0 +1,22 @@
// We previously mentioned other extern types in the error message here.
//
// Two extern types shouldn't really be considered similar just
// because they are both extern types.
#![feature(extern_types)]
extern {
type ShouldNotBeMentioned;
}
extern {
type Foo;
}
unsafe impl Send for ShouldNotBeMentioned {}
fn assert_send<T: Send + ?Sized>() {}
fn main() {
assert_send::<Foo>()
//~^ ERROR `Foo` cannot be sent between threads safely
}

View file

@ -0,0 +1,16 @@
error[E0277]: `Foo` cannot be sent between threads safely
--> $DIR/extern-type-diag-not-similar.rs:20:19
|
LL | assert_send::<Foo>()
| ^^^ `Foo` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `Foo`
note: required by a bound in `assert_send`
--> $DIR/extern-type-diag-not-similar.rs:17:19
|
LL | fn assert_send<T: Send + ?Sized>() {}
| ^^^^ required by this bound in `assert_send`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.

View file

@ -0,0 +1,5 @@
fn main() {
0.....{loop{}1};
//~^ ERROR unexpected token
//~| ERROR mismatched types
}

View file

@ -0,0 +1,35 @@
error: unexpected token: `...`
--> $DIR/issue-96335.rs:2:6
|
LL | 0.....{loop{}1};
| ^^^
|
help: use `..` for an exclusive range
|
LL | 0....{loop{}1};
| ~~
help: or `..=` for an inclusive range
|
LL | 0..=..{loop{}1};
| ~~~
error[E0308]: mismatched types
--> $DIR/issue-96335.rs:2:9
|
LL | 0.....{loop{}1};
| ----^^^^^^^^^^^
| | |
| | expected integer, found struct `RangeTo`
| arguments to this function are incorrect
|
= note: expected type `{integer}`
found struct `RangeTo<{integer}>`
note: associated function defined here
--> $SRC_DIR/core/src/ops/range.rs:LL:COL
|
LL | pub const fn new(start: Idx, end: Idx) -> Self {
| ^^^
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0308`.

View file

@ -1,4 +1,22 @@
static s: &'static str =
r#"
"## //~ too many `#` when terminating raw string
r#""## //~ ERROR too many `#` when terminating raw string
;
static s2: &'static str =
r#"
"#### //~ ERROR too many `#` when terminating raw string
;
const A: &'static str = r"" //~ ERROR expected `;`, found `#`
// Test
#[test]
fn test() {}
const B: &'static str = r""## //~ ERROR too many `#` when terminating raw string
// Test
#[test]
fn test2() {}
fn main() {}

View file

@ -1,10 +1,36 @@
error: too many `#` when terminating raw string
--> $DIR/raw-str-unbalanced.rs:3:9
--> $DIR/raw-str-unbalanced.rs:2:10
|
LL | "##
| ^ help: remove the extra `#`
LL | r#""##
| -----^ help: remove the extra `#`
| |
| this raw string started with 1 `#`
error: too many `#` when terminating raw string
--> $DIR/raw-str-unbalanced.rs:7:9
|
= note: the raw string started with 1 `#`s
LL | / r#"
LL | | "####
| | -^^^ help: remove the extra `#`s
| |________|
| this raw string started with 1 `#`
error: aborting due to previous error
error: expected `;`, found `#`
--> $DIR/raw-str-unbalanced.rs:10:28
|
LL | const A: &'static str = r""
| ^ help: add `;` here
...
LL | #[test]
| - unexpected token
error: too many `#` when terminating raw string
--> $DIR/raw-str-unbalanced.rs:16:28
|
LL | const B: &'static str = r""##
| ---^^ help: remove the extra `#`s
| |
| this raw string started with 0 `#`s
error: aborting due to 4 previous errors