Skip to content

Commit

Permalink
Merge branch 'rust-lang:master' into rwlock-downgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
connortsui20 authored Jul 26, 2024
2 parents 34e255d + 2f26b2a commit 7b69de9
Show file tree
Hide file tree
Showing 494 changed files with 5,381 additions and 3,746 deletions.
18 changes: 9 additions & 9 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -986,14 +986,14 @@ dependencies = [
]

[[package]]
name = "derivative"
version = "2.2.0"
name = "derive-where"
version = "1.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b"
checksum = "62d671cc41a825ebabc75757b62d3d168c577f9149b2d49ece1dad1f72119d25"
dependencies = [
"proc-macro2",
"quote",
"syn 1.0.109",
"syn 2.0.67",
]

[[package]]
Expand Down Expand Up @@ -3882,7 +3882,6 @@ dependencies = [
"termcolor",
"termize",
"tracing",
"unicode-width",
"windows",
]

Expand Down Expand Up @@ -4249,7 +4248,7 @@ name = "rustc_middle"
version = "0.0.0"
dependencies = [
"bitflags 2.5.0",
"derivative",
"derive-where",
"either",
"field-offset",
"gsgdt",
Expand Down Expand Up @@ -4379,7 +4378,7 @@ name = "rustc_next_trait_solver"
version = "0.0.0"
dependencies = [
"bitflags 2.5.0",
"derivative",
"derive-where",
"rustc_ast_ir",
"rustc_data_structures",
"rustc_index",
Expand Down Expand Up @@ -4629,7 +4628,7 @@ dependencies = [
name = "rustc_span"
version = "0.0.0"
dependencies = [
"derivative",
"derive-where",
"indexmap",
"itoa",
"md-5",
Expand Down Expand Up @@ -4769,7 +4768,7 @@ name = "rustc_type_ir"
version = "0.0.0"
dependencies = [
"bitflags 2.5.0",
"derivative",
"derive-where",
"indexmap",
"rustc_ast_ir",
"rustc_data_structures",
Expand Down Expand Up @@ -5206,6 +5205,7 @@ name = "stable_mir"
version = "0.1.0-preview"
dependencies = [
"scoped-tls",
"serde",
]

[[package]]
Expand Down
2 changes: 1 addition & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Version 1.80 (2024-07-25)
Version 1.80.0 (2024-07-25)
==========================

<a id="1.80-Language"></a>
Expand Down
39 changes: 38 additions & 1 deletion compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use rustc_span::source_map::{respan, Spanned};
use rustc_span::symbol::{kw, sym, Ident, Symbol};
use rustc_span::{ErrorGuaranteed, Span, DUMMY_SP};
use std::borrow::Cow;
use std::cmp;
use std::fmt;
use std::mem;
Expand Down Expand Up @@ -2264,6 +2265,42 @@ bitflags::bitflags! {
}
}

impl InlineAsmOptions {
pub fn human_readable_names(&self) -> Vec<&'static str> {
let mut options = vec![];

if self.contains(InlineAsmOptions::PURE) {
options.push("pure");
}
if self.contains(InlineAsmOptions::NOMEM) {
options.push("nomem");
}
if self.contains(InlineAsmOptions::READONLY) {
options.push("readonly");
}
if self.contains(InlineAsmOptions::PRESERVES_FLAGS) {
options.push("preserves_flags");
}
if self.contains(InlineAsmOptions::NORETURN) {
options.push("noreturn");
}
if self.contains(InlineAsmOptions::NOSTACK) {
options.push("nostack");
}
if self.contains(InlineAsmOptions::ATT_SYNTAX) {
options.push("att_syntax");
}
if self.contains(InlineAsmOptions::RAW) {
options.push("raw");
}
if self.contains(InlineAsmOptions::MAY_UNWIND) {
options.push("may_unwind");
}

options
}
}

impl std::fmt::Debug for InlineAsmOptions {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
bitflags::parser::to_writer(self, f)
Expand All @@ -2272,7 +2309,7 @@ impl std::fmt::Debug for InlineAsmOptions {

#[derive(Clone, PartialEq, Encodable, Decodable, Debug, Hash, HashStable_Generic)]
pub enum InlineAsmTemplatePiece {
String(String),
String(Cow<'static, str>),
Placeholder { operand_idx: usize, modifier: Option<char>, span: Span },
}

Expand Down
Loading

0 comments on commit 7b69de9

Please sign in to comment.