Skip to content

Commit b224fc8

Browse files
committed
Auto merge of #48017 - kennytm:rollup, r=kennytm
Rollup of 10 pull requests - Successful merges: #46030, #47496, #47543, #47704, #47753, #47807, #47948, #47959, #48003, #48007 - Failed merges:
2 parents 6c04c41 + 0553dc8 commit b224fc8

File tree

28 files changed

+188
-209
lines changed

28 files changed

+188
-209
lines changed

Diff for: src/Cargo.lock

+45-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: src/doc/book

Submodule book updated 122 files

Diff for: src/doc/reference

Diff for: src/doc/unstable-book/src/language-features/use-nested-groups.md

-90
This file was deleted.

Diff for: src/libcore/convert.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ pub trait AsRef<T: ?Sized> {
141141
///
142142
/// # Generic Implementations
143143
///
144-
/// - `AsMut` auto-dereferences if the inner type is a reference or a mutable
145-
/// reference (e.g.: `foo.as_ref()` will work the same if `foo` has type
146-
/// `&mut Foo` or `&&mut Foo`)
144+
/// - `AsMut` auto-dereferences if the inner type is a mutable reference
145+
/// (e.g.: `foo.as_mut()` will work the same if `foo` has type `&mut Foo`
146+
/// or `&mut &mut Foo`)
147147
///
148148
/// # Examples
149149
///

Diff for: src/librustc/lint/context.rs

+14-5
Original file line numberDiff line numberDiff line change
@@ -1042,11 +1042,20 @@ pub fn check_ast_crate(sess: &Session, krate: &ast::Crate) {
10421042
// Put the lint store levels and passes back in the session.
10431043
cx.lint_sess.restore(&sess.lint_store);
10441044

1045-
// Emit all buffered lints from early on in the session now that we've
1046-
// calculated the lint levels for all AST nodes.
1047-
for (_id, lints) in cx.buffered.map {
1048-
for early_lint in lints {
1049-
span_bug!(early_lint.span, "failed to process buffered lint here");
1045+
// All of the buffered lints should have been emitted at this point.
1046+
// If not, that means that we somehow buffered a lint for a node id
1047+
// that was not lint-checked (perhaps it doesn't exist?). This is a bug.
1048+
//
1049+
// Rustdoc runs everybody-loops before the early lints and removes
1050+
// function bodies, so it's totally possible for linted
1051+
// node ids to not exist (e.g. macros defined within functions for the
1052+
// unused_macro lint) anymore. So we only run this check
1053+
// when we're not in rustdoc mode. (see issue #47639)
1054+
if !sess.opts.actually_rustdoc {
1055+
for (_id, lints) in cx.buffered.map {
1056+
for early_lint in lints {
1057+
span_bug!(early_lint.span, "failed to process buffered lint here");
1058+
}
10501059
}
10511060
}
10521061
}

Diff for: src/librustc_borrowck/borrowck/mod.rs

+1-11
Original file line numberDiff line numberDiff line change
@@ -1068,22 +1068,12 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
10681068
};
10691069

10701070
match cause {
1071-
mc::AliasableStatic => {
1072-
// This happens when we have an `&mut` or assignment to a
1073-
// static. We should have already reported a mutability
1074-
// violation first, but may have continued compiling.
1075-
self.tcx.sess.delay_span_bug(
1076-
span,
1077-
&format!("aliasability violation for static `{}`", prefix)
1078-
);
1079-
return;
1080-
}
10811071
mc::AliasableStaticMut => {
10821072
// This path cannot occur. `static mut X` is not checked
10831073
// for aliasability violations.
10841074
span_bug!(span, "aliasability violation for static mut `{}`", prefix)
10851075
}
1086-
mc::AliasableBorrowed => {}
1076+
mc::AliasableStatic | mc::AliasableBorrowed => {}
10871077
};
10881078
let blame = cmt.immutability_blame();
10891079
let mut err = match blame {

Diff for: src/librustc_save_analysis/lib.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
791791
field_ref: &ast::Field,
792792
variant: &ty::VariantDef,
793793
) -> Option<Ref> {
794-
let f = variant.field_named(field_ref.ident.node.name);
794+
let f = variant.find_field_named(field_ref.ident.node.name)?;
795795
// We don't really need a sub-span here, but no harm done
796796
let sub_span = self.span_utils.span_for_last_ident(field_ref.ident.span);
797797
filter!(self.span_utils, sub_span, field_ref.ident.span, None);
@@ -870,6 +870,17 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
870870
result.push_str(&val.as_str());
871871
}
872872
result.push('\n');
873+
} else if let Some(meta_list) = attr.meta_item_list() {
874+
meta_list.into_iter()
875+
.filter(|it| it.check_name("include"))
876+
.filter_map(|it| it.meta_item_list().map(|l| l.to_owned()))
877+
.flat_map(|it| it)
878+
.filter(|meta| meta.check_name("contents"))
879+
.filter_map(|meta| meta.value_str())
880+
.for_each(|val| {
881+
result.push_str(&val.as_str());
882+
result.push('\n');
883+
});
873884
}
874885
}
875886
}

Diff for: src/libstd/ffi/c_str.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -1026,9 +1026,9 @@ impl CStr {
10261026
/// The returned slice will **not** contain the trailing nul terminator that this C
10271027
/// string has.
10281028
///
1029-
/// > **Note**: This method is currently implemented as a 0-cost cast, but
1030-
/// > it is planned to alter its definition in the future to perform the
1031-
/// > length calculation whenever this method is called.
1029+
/// > **Note**: This method is currently implemented as a constant-time
1030+
/// > cast, but it is planned to alter its definition in the future to
1031+
/// > perform the length calculation whenever this method is called.
10321032
///
10331033
/// # Examples
10341034
///
@@ -1077,9 +1077,9 @@ impl CStr {
10771077
/// it will return an error with details of where UTF-8 validation failed.
10781078
///
10791079
/// > **Note**: This method is currently implemented to check for validity
1080-
/// > after a 0-cost cast, but it is planned to alter its definition in the
1081-
/// > future to perform the length calculation in addition to the UTF-8
1082-
/// > check whenever this method is called.
1080+
/// > after a constant-time cast, but it is planned to alter its definition
1081+
/// > in the future to perform the length calculation in addition to the
1082+
/// > UTF-8 check whenever this method is called.
10831083
///
10841084
/// [`&str`]: ../primitive.str.html
10851085
///
@@ -1110,9 +1110,9 @@ impl CStr {
11101110
/// with the result.
11111111
///
11121112
/// > **Note**: This method is currently implemented to check for validity
1113-
/// > after a 0-cost cast, but it is planned to alter its definition in the
1114-
/// > future to perform the length calculation in addition to the UTF-8
1115-
/// > check whenever this method is called.
1113+
/// > after a constant-time cast, but it is planned to alter its definition
1114+
/// > in the future to perform the length calculation in addition to the
1115+
/// > UTF-8 check whenever this method is called.
11161116
///
11171117
/// [`Cow`]: ../borrow/enum.Cow.html
11181118
/// [`Borrowed`]: ../borrow/enum.Cow.html#variant.Borrowed

0 commit comments

Comments
 (0)