Comply with rust-lang/rfcs#2140 (#815)

This commit is contained in:
éclairevoyant 2023-07-29 08:48:13 -04:00 committed by GitHub
parent 25e50eda46
commit acf255f24a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 556 additions and 429 deletions

975
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -53,7 +53,7 @@ pub fn anyhow_err_to_diagnostic(err: &anyhow::Error) -> Option<Diagnostic<usize>
} }
pub fn stringify_diagnostic(mut diagnostic: codespan_reporting::diagnostic::Diagnostic<usize>) -> anyhow::Result<String> { pub fn stringify_diagnostic(mut diagnostic: codespan_reporting::diagnostic::Diagnostic<usize>) -> anyhow::Result<String> {
diagnostic.labels.drain_filter(|label| Span(label.range.start, label.range.end, label.file_id).is_dummy()); diagnostic.labels.retain(|label| !Span(label.range.start, label.range.end, label.file_id).is_dummy());
let mut config = term::Config::default(); let mut config = term::Config::default();
let mut chars = Chars::box_drawing(); let mut chars = Chars::box_drawing();

View file

@ -1,9 +1,9 @@
#![feature(trace_macros)] #![feature(trace_macros)]
#![feature(drain_filter)] #![feature(extract_if)]
#![feature(box_patterns)] #![feature(box_patterns)]
#![feature(slice_concat_trait)] #![feature(slice_concat_trait)]
#![feature(try_blocks)] #![feature(try_blocks)]
#![feature(hash_drain_filter)] #![feature(hash_extract_if)]
#![allow(rustdoc::private_intra_doc_links)] #![allow(rustdoc::private_intra_doc_links)]
extern crate gtk; extern crate gtk;

View file

@ -127,7 +127,7 @@ static DEPRECATED_ATTRS: Lazy<HashSet<&str>> =
/// @desc these properties apply to _all_ widgets, and can be used anywhere! /// @desc these properties apply to _all_ widgets, and can be used anywhere!
pub(super) fn resolve_widget_attrs(bargs: &mut BuilderArgs, gtk_widget: &gtk::Widget) -> Result<()> { pub(super) fn resolve_widget_attrs(bargs: &mut BuilderArgs, gtk_widget: &gtk::Widget) -> Result<()> {
let deprecated: HashSet<_> = DEPRECATED_ATTRS.to_owned(); let deprecated: HashSet<_> = DEPRECATED_ATTRS.to_owned();
let contained_deprecated: Vec<_> = bargs.unhandled_attrs.drain_filter(|a, _| deprecated.contains(&a.0 as &str)).collect(); let contained_deprecated: Vec<_> = bargs.unhandled_attrs.extract_if(|a, _| deprecated.contains(&a.0 as &str)).collect();
if !contained_deprecated.is_empty() { if !contained_deprecated.is_empty() {
let diag = error_handling_ctx::stringify_diagnostic(gen_diagnostic! { let diag = error_handling_ctx::stringify_diagnostic(gen_diagnostic! {
kind = Severity::Error, kind = Severity::Error,

View file

@ -1,4 +1,4 @@
[toolchain] [toolchain]
channel = "nightly-2022-08-27" channel = "nightly-2023-07-14"
components = [ "rust-src" ] components = [ "rust-src" ]
profile = "default" profile = "default"