Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d6d2ff0
Remove a stray comment that shouldn't be here.
nnethercote May 26, 2024
3607cee
Use let chains in `pretty_printing_compatibility_hack`.
nnethercote May 26, 2024
cf0c2c7
Convert `proc_macro_back_compat` lint to an unconditional error.
nnethercote May 26, 2024
940594f
Explain LazyCell in core::cell overview
workingjubilee May 27, 2024
fdb96f2
Differ LazyLock vs. OnceLock in std::sync overview
workingjubilee May 27, 2024
2d0ebca
Move first OnceLock example to LazyLock
workingjubilee May 27, 2024
9ed7cfc
Add "OnceList" example to motivate OnceLock
workingjubilee May 27, 2024
d392c50
Ignore `vec_deque_alloc_error::test_shrink_to_unwind` test on non-unw…
Veykril Jun 3, 2024
e9c4eb3
chore: update src/tools/rustc-perf
weihanglo May 31, 2024
9436fbe
Fix typo in the docs of `HashMap::raw_entry_mut`
its-the-shrimp Jun 3, 2024
47053d1
Update books
rustbot Jun 3, 2024
832b8b8
Update fuchsia maintainers
P1n3appl3 Jun 3, 2024
0a11dcf
feat(opt-dist): new flag `--benchmark-cargo-config`
weihanglo Jun 3, 2024
b7a8f1f
Include trailing commas in functions
Sergi-Ferrez Jun 4, 2024
6a84995
Add function `core::iter::chain`
rossmacarthur Jun 4, 2024
617e64c
Update code format and tests
Sergi-Ferrez Jun 4, 2024
744dc8c
Use checked_sub
Sergi-Ferrez Jun 4, 2024
c7491a9
Remove `tests/run-make-fulldeps/pretty-expanded`
Zalathar Jun 4, 2024
7e993b2
Create `run-make` `env_var` and `env_var_os` helpers
GuillaumeGomez Jun 3, 2024
190f221
Rollup merge of #106186 - rossmacarthur:ft/iter-chain, r=Amanieu
GuillaumeGomez Jun 4, 2024
fa96e2c
Rollup merge of #125596 - nnethercote:rental-hard-error, r=estebank
GuillaumeGomez Jun 4, 2024
ee04e0f
Rollup merge of #125696 - workingjubilee:please-dont-say-you-are-lazy…
GuillaumeGomez Jun 4, 2024
5364a14
Rollup merge of #125917 - GuillaumeGomez:env-var-helpers, r=jieyouxu
GuillaumeGomez Jun 4, 2024
d9e149d
Rollup merge of #125927 - ferrocene:lw-alloc-unwind-test, r=pietroalbini
GuillaumeGomez Jun 4, 2024
610592b
Rollup merge of #125930 - weihanglo:opt-dist-respect-cargo-config, r=…
GuillaumeGomez Jun 4, 2024
b6b1a46
Rollup merge of #125932 - schvv31n:patch-1, r=lqd
GuillaumeGomez Jun 4, 2024
1f1b644
Rollup merge of #125933 - rustbot:docs-update, r=ehuss
GuillaumeGomez Jun 4, 2024
47265df
Rollup merge of #125944 - P1n3appl3:fuchsia, r=lqd
GuillaumeGomez Jun 4, 2024
532aa9a
Rollup merge of #125946 - Sergi-Ferrez:master, r=notriddle,fmease
GuillaumeGomez Jun 4, 2024
f41c3e9
Rollup merge of #125973 - Zalathar:pretty, r=lqd
GuillaumeGomez Jun 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use let chains in pretty_printing_compatibility_hack.
To reduce indentation and improve readability.
  • Loading branch information
nnethercote committed May 27, 2024
commit 3607cee3e7009c91dfdf3d4f8669ac8156a36ac0
73 changes: 32 additions & 41 deletions compiler/rustc_expand/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1338,47 +1338,38 @@ pub fn parse_macro_name_and_helper_attrs(
/// FIXME(#73933): Remove this eventually.
fn pretty_printing_compatibility_hack(item: &Item, sess: &Session) -> bool {
let name = item.ident.name;
if name == sym::ProceduralMasqueradeDummyType {
if let ast::ItemKind::Enum(enum_def, _) = &item.kind {
if let [variant] = &*enum_def.variants {
if variant.ident.name == sym::Input {
let filename = sess.source_map().span_to_filename(item.ident.span);
if let FileName::Real(real) = filename {
if let Some(c) = real
.local_path()
.unwrap_or(Path::new(""))
.components()
.flat_map(|c| c.as_os_str().to_str())
.find(|c| c.starts_with("rental") || c.starts_with("allsorts-rental"))
{
let crate_matches = if c.starts_with("allsorts-rental") {
true
} else {
let mut version = c.trim_start_matches("rental-").split('.');
version.next() == Some("0")
&& version.next() == Some("5")
&& version
.next()
.and_then(|c| c.parse::<u32>().ok())
.is_some_and(|v| v < 6)
};

if crate_matches {
sess.psess.buffer_lint(
PROC_MACRO_BACK_COMPAT,
item.ident.span,
ast::CRATE_NODE_ID,
BuiltinLintDiag::ProcMacroBackCompat {
crate_name: "rental".to_string(),
fixed_version: "0.5.6".to_string(),
},
);
return true;
}
}
}
}
}
if name == sym::ProceduralMasqueradeDummyType
&& let ast::ItemKind::Enum(enum_def, _) = &item.kind
&& let [variant] = &*enum_def.variants
&& variant.ident.name == sym::Input
&& let FileName::Real(real) = sess.source_map().span_to_filename(item.ident.span)
&& let Some(c) = real
.local_path()
.unwrap_or(Path::new(""))
.components()
.flat_map(|c| c.as_os_str().to_str())
.find(|c| c.starts_with("rental") || c.starts_with("allsorts-rental"))
{
let crate_matches = if c.starts_with("allsorts-rental") {
true
} else {
let mut version = c.trim_start_matches("rental-").split('.');
version.next() == Some("0")
&& version.next() == Some("5")
&& version.next().and_then(|c| c.parse::<u32>().ok()).is_some_and(|v| v < 6)
};

if crate_matches {
sess.psess.buffer_lint(
PROC_MACRO_BACK_COMPAT,
item.ident.span,
ast::CRATE_NODE_ID,
BuiltinLintDiag::ProcMacroBackCompat {
crate_name: "rental".to_string(),
fixed_version: "0.5.6".to_string(),
},
);
return true;
}
}
false
Expand Down