diff options
| author | Celina G. Val <celinval@amazon.com> | 2023-12-06 21:33:49 -0800 |
|---|---|---|
| committer | Celina G. Val <celinval@amazon.com> | 2023-12-07 17:01:29 -0800 |
| commit | 9cb6463af7a9a67b8fdcd2c846b42310f4245e98 (patch) | |
| tree | e63820676ec62efaa55fe7025809363accb9e5e0 /compiler/stable_mir/src | |
| parent | 4c9e842a09bdde35bf76bc4690f665dfbac3bfd1 (diff) | |
| download | rust-9cb6463af7a9a67b8fdcd2c846b42310f4245e98.tar.gz rust-9cb6463af7a9a67b8fdcd2c846b42310f4245e98.zip | |
Fix conversion to StaticDef and add test
Diffstat (limited to 'compiler/stable_mir/src')
| -rw-r--r-- | compiler/stable_mir/src/compiler_interface.rs | 2 | ||||
| -rw-r--r-- | compiler/stable_mir/src/mir/mono.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/stable_mir/src/compiler_interface.rs b/compiler/stable_mir/src/compiler_interface.rs index 928f320c2fa..17c5212fb9c 100644 --- a/compiler/stable_mir/src/compiler_interface.rs +++ b/compiler/stable_mir/src/compiler_interface.rs @@ -162,7 +162,7 @@ pub trait Context { fn krate(&self, def_id: DefId) -> Crate; fn instance_name(&self, def: InstanceDef, trimmed: bool) -> Symbol; - /// Return the number of bytes for a pointer size. + /// Return information about the target machine. fn target_info(&self) -> MachineInfo; } diff --git a/compiler/stable_mir/src/mir/mono.rs b/compiler/stable_mir/src/mir/mono.rs index acf268e56b3..bc5d4a3b8f4 100644 --- a/compiler/stable_mir/src/mir/mono.rs +++ b/compiler/stable_mir/src/mir/mono.rs @@ -220,7 +220,7 @@ impl TryFrom<CrateItem> for StaticDef { type Error = crate::Error; fn try_from(value: CrateItem) -> Result<Self, Self::Error> { - if matches!(value.kind(), ItemKind::Static | ItemKind::Const) { + if matches!(value.kind(), ItemKind::Static) { Ok(StaticDef(value.0)) } else { Err(Error::new(format!("Expected a static item, but found: {value:?}"))) |
